Пример #1
0
        private void ClaimTask(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.TaskClaim() == 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());
            }
        }
        private void btnClaimTask_Click(object sender, EventArgs e)
        {
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                string operatorId    = BusinessLogic.ConvertToString(DTUnClaimedTaskList.Rows[dgvUnClaimedTask.SelectedRows[0].Index]["OPERATORINSID"]) ?? "";
                string workTaskInsId = BusinessLogic.ConvertToString(DTUnClaimedTaskList.Rows[dgvUnClaimedTask.SelectedRows[0].Index]["WORKTASKINSID"]) ?? "";
                var    wfruntime     = new WorkFlowRuntime
                {
                    UserId             = UserInfo.Id,
                    WorkTaskInstanceId = workTaskInsId,
                    OperatorInstanceId = operatorId,
                    CurrentUser        = this.UserInfo
                };
                if (wfruntime.TaskClaim() == WorkFlowConst.SuccessCode)
                {
                    MessageBoxHelper.ShowSuccessMsg("认领成功!");
                }
                this.Search();
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                this.Cursor = holdCursor;
            }
        }
Пример #3
0
        /// <summary>
        /// 认领任务
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClaimButtonEvent(object sender, EventArgs e)
        {
            var wfRuntime = new WorkFlowRuntime {
                UserId = userId, OperatorInstanceId = OperatorInsId
            };

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

            wfruntime.TaskClaim();
            Response.Redirect(Request.RawUrl);//刷新页面
        }
Пример #5
0
        private void btnHandleTask_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.Default;
            if (dgvToDoTask.SelectedRows.Count < 1)
            {
                return;
            }
            string operatorId    = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["OPERATORINSID"]) ?? "";
            string workTaskInsId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WORKTASKINSID"]) ?? "";
            string status        = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["STATUS"]) ?? "";

            if (status == "1")//如果是新任务首先要认领任务
            {
                var wfRuntime = new WorkFlowRuntime
                {
                    UserId             = UserInfo.Id,
                    WorkTaskInstanceId = workTaskInsId,
                    OperatorInstanceId = operatorId,
                    CurrentUser        = this.UserInfo
                };
                wfRuntime.TaskClaim();
            }

            //根据流程模板中配置的表单加载业务表单,如销售单。这里先固定的加载销售单。
            //var frm = new FrmCommTestAuditWF {operatorInsId = operatorId};
            //if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            //{
            //    Search(); //刷新列表
            //}

            var frmProcessTask = new FrmProcessingTask
            {
                WorkFlowId    = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WorkFlowId"]) ?? "",
                WorkFlowInsId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WorkFlowInsId"]) ?? "",
                WorkTaskId    = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WorkTaskId"]) ?? "",
                WorkTaskInsId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["WorkTaskInsId"]) ?? "",
                OperatorInsId = BusinessLogic.ConvertToString(DTToDoList.Rows[dgvToDoTask.SelectedRows[0].Index]["operatorInsId"]) ?? "",
                PageState     = WorkConst.STATE_MOD,
                OperStatus    = "3"
            };

            if (frmProcessTask.ShowDialog() == DialogResult.OK)
            {
                Search(); //刷新列表
            }
        }