1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;
namespace SharePointWF.WF
{
public sealed partial class WF : SequentialWorkflowActivity
{
public WF()
{
InitializeComponent();
}
public String sendEmail1_Body1;
public String sendEmail1_To1 ;
public String sendEmail1_Subject1 ;
SPWeb CurrentWeb = SPContext.Current.Web;
public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
bool approvalStatusStillPending = true;
// SPWeb CurrentWeb = SPContext.Current.Web;
private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
{
ChekApprovalStatus();
}
private void ChekApprovalStatus()
{
//try
// {
string approvalStatus = workflowProperties.Item["Approval Status"].ToString();
//approved
if (approvalStatus == "0")
{
approvalStatusStillPending = false;
}
//rejected
else if (approvalStatus == "1")
{
approvalStatusStillPending = false;
}
else
{
approvalStatusStillPending = true;
}
}
private void Approvalstatus(object sender, ConditionalEventArgs e)
{ e.Result = approvalStatusStillPending; }
private void onWorkflowItemChanged1_Invoked_1(object sender, ExternalDataEventArgs e)
{
ChekApprovalStatus();
}
private void sendEmail1_MethodInvoking(object sender, EventArgs e)
{
this.sendEmail1_Body1 = "hello";
this.sendEmail1_To1 = "msbahri@tps.com.tn";
this.sendEmail1_Subject1 = "test";
}
}
} |
Partager