private void createTask_Completion_MethodInvoking(object sender, EventArgs e) { SRMSharePointWorkflowUtil _lookup = new SRMSharePointWorkflowUtil(); string _listName = onWorkflowActivated1.WorkflowProperties.List.Title; string _regionName = _lookup.GetFieldValueLookup(onWorkflowActivated1.WorkflowProperties.Item, "Region Name"); string _requestType = _lookup.GetFieldValueLookup(onWorkflowActivated1.WorkflowProperties.Item, "SRM Request Type"); createTask_Completion_TaskId1 = Guid.NewGuid(); createTask_Completion_TaskProperties1.Title = "Complete " + onWorkflowActivated1.WorkflowProperties.Item.Title; createTask_Completion_TaskProperties1.DueDate = DateTime.Now.AddDays(1.0); createTask_Completion_TaskProperties1.Description = "<b>Activities:</b><br>" + "Complete work and set status to \"Completed\"<br>" + "Reject request by setting status to \"Rejected\"<br>" + "Rejected requests can be resubmitted" + "<br>" + "<b>Request info</b><br>" + "Region: " + _regionName + "<br>" + "Request type: " + _requestType + "<br>"; ; createTask_Completion_TaskProperties1.AssignedTo = _lookup.LookUpDeployer(_regionName, _requestType, _listName + " RegionTypeConfig", onWorkflowActivated1.WorkflowProperties.Item.Web.Url); onWorkflowActivated1.WorkflowProperties.Item["% Complete"] = 0.33; onWorkflowActivated1.WorkflowProperties.Item["Status"] = "Pending Completion"; onWorkflowActivated1.WorkflowProperties.Item.Update(); }
private void createTask_Approval_MethodInvoking(object sender, EventArgs e) { SRMSharePointWorkflowUtil _lookup = new SRMSharePointWorkflowUtil(); string _regionName = _lookup.GetFieldValueLookup(onWorkflowActivated1.WorkflowProperties.Item, "Region Name"); string _requestType = _lookup.GetFieldValueLookup(onWorkflowActivated1.WorkflowProperties.Item, "SRM Request Type"); string _listName = onWorkflowActivated1.WorkflowProperties.List.Title; createTask_Approval_TaskId1 = Guid.NewGuid(); createTask_Approval_TaskProperties1.Title = "Review " + onWorkflowActivated1.WorkflowProperties.Item.Title; createTask_Approval_TaskProperties1.DueDate = DateTime.Now.AddDays(1.0); createTask_Approval_TaskProperties1.Description = "<b>Activities:</b><br>" + "Please Review Request<br>" + "To approve set status to \"Approved\"<br>" + "To reject set status to \"Rejected\"<br>" + "Rejected requests can be resubmitted <br>" + "<br>" + "<b>Request info</b><br>" + "Region: " + _regionName + "<br>" + "Request type: " + _requestType + "<br>"; string _approver = _lookup.LookUpApprover(_regionName, _requestType, _listName + " RegionTypeConfig", onWorkflowActivated1.WorkflowProperties.Item.Web.Url); createTask_Approval_TaskProperties1.AssignedTo = _approver; onWorkflowActivated1.WorkflowProperties.Item[SPBuiltInFieldId.PercentComplete] = 0.0; onWorkflowActivated1.WorkflowProperties.Item["Status"] = "Pending Approval"; onWorkflowActivated1.WorkflowProperties.Item.Update(); }