Пример #1
0
        /// <summary>
        /// 任务退回
        /// </summary>
        /// <param name="ctx"></param>
        private void TaskBack(HttpContext ctx)
        {
            try
            {
                var vUser              = Utils.UserInfo;
                var workFlowInsId      = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("workFlowInsId"));
                var backCause          = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("backCause"));
                var operatorInstanceId = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("operatorInsId"));
                if (!string.IsNullOrEmpty(operatorInstanceId) && !string.IsNullOrEmpty(backCause) && workFlowInsId == "退回到上一步")
                {
                    var wfruntime = new WorkFlowRuntime
                    {
                        UserId             = vUser.Id,
                        backyy             = backCause,
                        OperatorInstanceId = operatorInstanceId,
                        CurrentUser        = vUser
                    };
                    ctx.Response.Write(wfruntime.TaskBack() == WorkFlowConst.SuccessCode
                        ? new JsonMessage {
                        Success = true, Data = "1", Message = "退回成功!"
                    }.ToString()
                        : new JsonMessage {
                        Success = false, Data = "0", Message = "退回失败!"
                    }.ToString());
                }

                //任意退回
                if (!string.IsNullOrEmpty(operatorInstanceId) && !string.IsNullOrEmpty(backCause) && !string.IsNullOrEmpty(workFlowInsId) && workFlowInsId != "退回到上一步")
                {
                    var wfRuntime = new WorkFlowRuntime
                    {
                        UserId             = vUser.Id,
                        backyy             = backCause,
                        OperatorInstanceId = operatorInstanceId,
                        //WorkTaskId = selectWorkFlowInsId,
                        WorkFlowInstanceId = workFlowInsId,
                        CurrentUser        = vUser
                    };
                    ctx.Response.Write(wfRuntime.TaskBackry() == WorkFlowConst.SuccessCode
                        ? new JsonMessage {
                        Success = true, Data = "1", Message = "任意退回成功!"
                    }.ToString()
                        : new JsonMessage {
                        Success = false, Data = "0", Message = "任意退回失败!"
                    }.ToString());
                }
            }
            catch (Exception ex)
            {
                ctx.Response.Write(new JsonMessage {
                    Success = false, Data = "-1", Message = RDIFrameworkMessage.MSG3020 + ex.Message
                }.ToString());
            }
        }
Пример #2
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            string selectWorkFlowInsId = BusinessLogic.ConvertToString(cboWorkStep.SelectedValue);

            if (!this.CheckInput())
            {
                return;
            }

            if (this.OperatorInstanceId != null && selectWorkFlowInsId == "退回到上一步")
            {
                OperatorInstanceId = this.OperatorInstanceId;
                var wfRuntime = new WorkFlowRuntime
                {
                    UserId             = this.UserInfo.Id,
                    backyy             = txtBackCause.Text,
                    OperatorInstanceId = OperatorInstanceId,
                    CurrentUser        = this.UserInfo
                };
                wfRuntime.TaskBack();
                MessageBoxHelper.ShowSuccessMsg("退回成功");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            //任意退回
            if (this.OperatorInstanceId != null && !string.IsNullOrEmpty(txtBackCause.Text) && selectWorkFlowInsId != "退回到上一步")
            {
                OperatorInstanceId = this.OperatorInstanceId;
                WorkFlowInsId      = selectWorkFlowInsId;
                var wfRuntime = new WorkFlowRuntime
                {
                    UserId             = this.UserInfo.Id,
                    backyy             = txtBackCause.Text,
                    OperatorInstanceId = OperatorInstanceId,
                    //WorkTaskId = selectWorkFlowInsId,
                    WorkFlowInstanceId = WorkFlowInsId,
                    CurrentUser        = this.UserInfo
                };
                wfRuntime.TaskBackry();
                MessageBoxHelper.ShowSuccessMsg("任意退回成功");
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }