Exemplo n.º 1
0
 public virtual bool ChangeSign(string fromUserCode, string toUserCode, string sn, string instanceId, string remark)
 {
     try
     {
         string action = "转签";
         activityName = GetCurrentActiveName(sn);
         WorkflowHelper.ForwardToNextApprover_Change(_BPMContext.Sn, fromUserCode, toUserCode);
         return(AddApprovalOption(sn, action, remark, "2", activityName) && AfterAddOrChangeSign(fromUserCode, toUserCode, instanceId, action, remark));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
    protected void lbSelected_Command(object sender, CommandEventArgs e)
    {
        int result = 0;

        try
        {
            string userDomainName = e.CommandArgument.ToString();
            if (userDomainName.ToLower().Contains("founder\\"))
            {
                userDomainName = "founder\\" + userDomainName;
            }

            WorkflowHelper.ForwardToNextApprover_Change(_BPMContext.Sn, _BPMContext.CurrentUser.LoginId, userDomainName);

            string Opinion = Request["optionTxt"];

            //2015-1-26 对转签的已办做增加Item处理,去掉为空意见优化
            string ApproveResult    = "转签";
            string OpinionType      = "";
            string IsSign           = "2";
            string DelegateUserName = "";
            string DelegateUserCode = "";

            WorkFlowInstance workFlowInstance = new WF_WorkFlowInstance().GetWorkFlowInstanceById(_BPMContext.ProcID);
            var appRecord = new Pkurg.PWorldBPM.Business.Sys.WF_Approval_Record()
            {
                ApprovalID        = Guid.NewGuid().ToString(),
                WFTaskID          = K2_TaskItem.ID,
                FormID            = workFlowInstance.FormId,
                InstanceID        = workFlowInstance.InstanceId,
                Opinion           = Opinion,
                ApproveAtTime     = DateTime.Now,
                ApproveByUserCode = _BPMContext.CurrentPWordUser.EmployeeCode,
                ApproveByUserName = _BPMContext.CurrentPWordUser.EmployeeName,
                ApproveResult     = ApproveResult,
                OpinionType       = OpinionType,
                CurrentActiveName = CustomWorkflowHelper.SuperNodeName == K2_TaskItem.ActivityInstanceDestination.Name ? CustomWorkflowDataProcess.GetCurrentStepNameById(_BPMContext.ProcID, K2_TaskItem.ActivityInstanceDestination.Name) : K2_TaskItem.ActivityInstanceDestination.Name,
                ISSign            = IsSign,
                CurrentActiveID   = K2_TaskItem.ActivityInstanceDestination.ActID.ToString(),
                DelegateUserName  = DelegateUserName,
                DelegateUserCode  = DelegateUserCode,
                CreateAtTime      = K2_TaskItem.ActivityInstanceDestination.StartDate,
                CreateByUserCode  = _BPMContext.CurrentPWordUser.EmployeeCode,
                CreateByUserName  = _BPMContext.CurrentPWordUser.EmployeeName,
                UpdateAtTime      = DateTime.Now,
                UpdateByUserCode  = _BPMContext.CurrentPWordUser.EmployeeCode,
                UpdateByUserName  = _BPMContext.CurrentPWordUser.EmployeeName,
                FinishedTime      = DateTime.Now
            };

            if (new BFApprovalRecord().AddApprovalRecord(appRecord))
            {
                if (new WF_WorkFlowInstance().UpdateStatus(workFlowInstance.WfInstanceId,
                                                           "1", K2_TaskItem.ActivityInstanceDestination.ID.ToString(),
                                                           K2_TaskItem.ActivityInstanceDestination.Name, K2_TaskItem.ID, null,
                                                           _BPMContext.CurrentPWordUser))
                {
                    result = 1;
                }
            }
        }
        catch (Exception)
        {
        }
        DisplayMessage.ExecuteJs(string.Format("window.returnValue = {0};window.close();", result));
    }