Exemplo n.º 1
0
 /// <summary>
 /// 任务指派
 /// </summary>
 /// <param name="ctx"></param>
 private void AssignTask(HttpContext ctx)
 {
     try
     {
         var vUser = Utils.UserInfo;
         var operatorInstanceId = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("operatorInsId"));
         var assginUserId       = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("assginUserId"));
         if (!string.IsNullOrEmpty(operatorInstanceId))
         {
             var wfRuntime = new WorkFlowRuntime
             {
                 UserId             = vUser.Id,
                 AssignUserId       = assginUserId,
                 OperatorInstanceId = operatorInstanceId,
                 CurrentUser        = vUser
             };
             ctx.Response.Write(wfRuntime.TaskAssign() == 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());
     }
 }
Exemplo n.º 2
0
        private void btnAssign_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.SelectedId))
            {
                MessageBoxHelper.ShowWarningMsg("请选择待指派的用户!");
                return;
            }

            try
            {
                var wfRuntime = new WorkFlowRuntime
                {
                    UserId             = this.UserInfo.Id,
                    AssignUserId       = this.SelectedId,
                    OperatorInstanceId = OperatorInstanceId,
                    CurrentUser        = this.UserInfo
                };
                string statusCode = wfRuntime.TaskAssign();
                if (statusCode == WorkFlowConst.SuccessCode)
                {
                    MessageBoxHelper.ShowSuccessMsg("指派成功!");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBoxHelper.ShowErrorMsg("指派失败,请检查传递的参数是否正确!");
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
        }