Example #1
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(); //刷新列表
            }
        }
Example #2
0
        private void btnViewTask_Click(object sender, EventArgs e)
        {
            if (dgvToDoTask.SelectedRows.Count < 1)
            {
                return;
            }
            var frmProcessTask = new FrmProcessingTask
            {
                WorkFlowId    = BusinessLogic.ConvertToString(MyParticipantTaskList.Rows[dgvToDoTask.SelectedRows[0].Index][WorkTaskInstanceTable.FieldWorkFlowId]) ?? "",
                WorkFlowInsId = BusinessLogic.ConvertToString(MyParticipantTaskList.Rows[dgvToDoTask.SelectedRows[0].Index][WorkTaskInstanceTable.FieldWorkFlowInsId]) ?? "",
                WorkTaskId    = BusinessLogic.ConvertToString(MyParticipantTaskList.Rows[dgvToDoTask.SelectedRows[0].Index][WorkTaskInstanceTable.FieldWorkTaskId]) ?? "",
                WorkTaskInsId = BusinessLogic.ConvertToString(MyParticipantTaskList.Rows[dgvToDoTask.SelectedRows[0].Index][WorkTaskInstanceTable.FieldWorkTaskInsId]) ?? "",
                OperatorInsId = BusinessLogic.ConvertToString(MyParticipantTaskList.Rows[dgvToDoTask.SelectedRows[0].Index][WorkTaskInstanceTable.FieldOperatorInsId]) ?? "",
                PageState     = WorkConst.STATE_VIEW,
                OperStatus    = "1"
            };

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