Beispiel #1
0
        //放弃认领
        private void btnUnClaim_Click(object sender, EventArgs e)
        {
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                var wfRuntime = new WorkFlowRuntime
                {
                    UserId             = UserInfo.Id,
                    WorkTaskInstanceId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WORKTASKINSID"]) ?? "",
                    OperatorInstanceId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["OPERATORINSID"]) ?? "",
                    CurrentUser        = this.UserInfo
                };
                string statusCode = wfRuntime.TaskUnClaim();
                if (statusCode != WorkFlowConst.SuccessCode)
                {
                    MessageBoxHelper.ShowWarningMsg("放弃任务认领错误");
                }
                else
                {
                    MessageBoxHelper.ShowSuccessMsg("放弃任务认领成功!");
                    this.Search();
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                this.Cursor = holdCursor;
            }
        }
Beispiel #2
0
        private void GiveupClaimTask(HttpContext ctx)
        {
            var operatorId    = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("operatorId"));
            var workTaskInsId = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("workTaskInsId"));
            var vUser         = Utils.UserInfo;

            try
            {
                var wfruntime = new WorkFlowRuntime
                {
                    UserId             = vUser.Id,
                    WorkTaskInstanceId = workTaskInsId,
                    OperatorInstanceId = operatorId,
                    CurrentUser        = vUser
                };

                ctx.Response.Write(wfruntime.TaskUnClaim() == WorkFlowConst.SuccessCode
                    ? new JsonMessage {
                    Success = true, Data = "1", Message = RDIFrameworkMessage.MSG3010
                }.ToString()
                    : new JsonMessage {
                    Success = false, Data = "0", Message = RDIFrameworkMessage.MSG3020
                }.ToString());
            }
            catch (Exception ex)
            {
                ctx.Response.Write(new JsonMessage {
                    Success = false, Data = "-1", Message = RDIFrameworkMessage.MSG3020 + ex.Message
                }.ToString());
            }
        }
Beispiel #3
0
        /// <summary>
        /// 任务放弃认领
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TaskAbnegateButtonEvent(object sender, EventArgs e)
        {
            var wfruntime = new WorkFlowRuntime
            {
                UserId             = userId,
                OperatorInstanceId = OperatorInsId,
                CurrentUser        = this.UserInfo
            };

            wfruntime.TaskUnClaim();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        /// <summary>
        /// 任务放弃认领
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TaskAbnegateButtonEvent(object sender, EventArgs e)
        {
            var wfruntime = new WorkFlowRuntime
            {
                UserId             = this.UserInfo.Id,
                OperatorInstanceId = operatorInsId,
                CurrentUser        = this.UserInfo
            };

            wfruntime.TaskUnClaim();
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "alert('放弃认领成功!');", true);
            Response.Redirect(Request.RawUrl);//刷新页面
        }