コード例 #1
0
        private void LoadData()
        {
            string code     = Request["ApplicationCode"] + "";
            string caseCode = Request["CaseCode"] + "";

            string procedureCode = Request["ProcedureCode"] + "";
            string procedureName = Request["ProcedureName"] + "";
            string userCode      = Request["UserCode"] + "";
            string unitCode      = Request["UnitCodeCode"] + "";

            WorkCase workCase = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode);

            Procedure procedure = DefinitionManager.GetProcedureDifinition(workCase.ProcedureCode, true);

            if (procedure == null)
            {
                LogHelper.WriteLog("取不到对应流程");
                throw new Exception("流程配置有误,取不到对应流程");
            }


            Act currentAct = workCase.GetAct(Request["ActCode"] + "");

            if (currentAct == null)
            {
                LogHelper.WriteLog("取不到当前流程节点");
                throw new Exception("非法操作,取不到当前流程节点");
            }

            /*if(Request["ActCode"]+"" != "")
             * {
             *      Act act = workCase.GetAct(Request["ActCode"]+"");
             *      if(act.Copy == 0)
             *              this.ChkShow.Checked = (act.IsSleep == 1);
             *      else
             *              this.ChkShow.Visible = false;
             * }*/

            System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator();
            while (ie.MoveNext())
            {
                Opinion Flowopinion = (Opinion)ie.Value;
                if (Flowopinion.ApplicationCode == Request["ActCode"] + "")
                {
                    this.FlowOpinion.Value = Flowopinion.OpinionText;
                    switch (this.up_sPMName.ToLower())
                    {
                    case "shimaopm":
                        if (Flowopinion.OpinionText.Trim() == "")
                        {
                            Task firstTask = DefinitionManager.GetFirstTask(procedure);
                            if (firstTask == null)
                            {
                                LogHelper.WriteLog("流程取不到开始节点");
                                throw new Exception("流程配置有误,请检查开始节点的属性");
                            }
                            if (currentAct.ToTaskCode == firstTask.TaskCode)
                            {
                                this.FlowOpinion.Value = "";
                            }
                            else
                            {
                                this.FlowOpinion.Value = "同意";
                            }
                        }
                        break;
                    }
                }
            }
        }
コード例 #2
0
        private void LoadData()
        {
            string code     = Request["ApplicationCode"] + "";
            string caseCode = Request["CaseCode"] + "";

            string procedureCode = Request["ProcedureCode"] + "";
            string procedureName = Request["ProcedureName"] + "";
            //if ( procedureCode == "" )
            //	procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName);

            bool   isNew    = (caseCode == "");
            string userCode = Request["UserCode"] + "";
            string unitCode = Request["UnitCodeCode"] + "";


            Procedure procedure      = DefinitionManager.GetProcedureDifinition(procedureCode, true);
            string    currentActCode = Request["ActCode"] + "";
            Act       currentAct     = null;
            string    actCode        = "";
            WorkCase  workCase       = null;

            if (isNew)
            {
                workCase   = Rms.WorkFlow.WorkCaseManager.StartNewWorkCase(code, procedureCode, userCode, unitCode, ref actCode, "", "");
                currentAct = (Act)(WorkCaseManager.GetActivityAct(workCase)[0]);
                if (currentAct.ApplicationSubject != null)
                {
                    this.rdoCheck.SelectedValue = currentAct.ApplicationSubject.ToString();
                }
            }
            else
            {
                workCase   = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode);
                currentAct = workCase.GetAct(Request["ActCode"] + "");
                if (currentAct.ApplicationSubject != null)
                {
                    this.rdoCheck.SelectedValue = currentAct.ApplicationSubject.ToString();
                }
            }


            //this.ChkShow.Checked = (currentAct.IsSleep == 1);


            System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator();
            while (ie.MoveNext())
            {
                Opinion Flowopinion = (Opinion)ie.Value;
                if (Flowopinion.ApplicationCode == currentAct.ActCode)
                {
                    this.FlowOpinion.Value = Flowopinion.OpinionText;
                    switch (this.up_sPMName.ToLower())
                    {
                    case "shimaopm":
                        if (Flowopinion.OpinionText.Trim() == "")
                        {
                            Task firstTask = DefinitionManager.GetFirstTask(procedure);
                            if (currentAct.ToTaskCode == firstTask.TaskCode)
                            {
                                this.FlowOpinion.Value = "";
                            }
                            else
                            {
                                this.FlowOpinion.Value = "同意";
                            }
                        }
                        break;
                    }
                }
            }


            this.txtCurrentActCode.Value = currentAct.ActCode;

            Task currentTask = procedure.GetTask(currentAct.ToTaskCode);

            //是否需要等待
            this.WaitForFlag.Checked = (currentTask.CanEdit == 1);
            this.CopyName.InnerHtml  = currentTask.TaskActorType;
            FillCopyUserSelect(workCase, procedure, currentTask);
            if (Request["Work"] + "" == "Send")
            {
                FillSendCopyUserSelect(workCase, procedure, currentTask);
            }

            this.txtProcedureCode.Value   = procedureCode;
            this.txtCurrentTaskCode.Value = currentTask.TaskCode;

            if (currentTask.Copy != 1)
            {
                this.CopyTable.Visible = false;
                this.CopyTitle.Visible = false;
            }

            // 填充路由rbl
            DataSet  ds = Rms.WorkFlow.DefinitionManager.SaveProcedureDefinitionData(procedure);
            DataView dv = new DataView(ds.Tables["WorkFlowRouter"], String.Format(" FromTaskCode='{0}' ", currentTask.TaskCode), "SortID", DataViewRowState.CurrentRows);

            /////////////////创建属性表///////////////////
            DataTable PropertyTable = BLL.WorkFlowRule.GetPropertyTable(workCase, procedure);

            if (Request["Debug"] + "" == "1")
            {
                this.DataGrid1.DataSource = PropertyTable;
                this.DataGrid1.DataBind();
            }
            //PropertyTable.Rows.Add(PropertyRow);

            for (int i = 0; i < dv.Table.Rows.Count; i++)
            {
                System.Collections.IDictionaryEnumerator iecondition = procedure.GetRouter((string)dv.Table.Rows[i]["RouterCode"]).GetConditionEnumerator();
                if (iecondition.MoveNext())
                {
                    Condition condition = (Condition)iecondition.Value;
                    if (PropertyTable.Select(condition.Description).Length == 0)
                    {
                        dv.Table.Rows.Remove(dv.Table.Rows[i]);
                        i--;
                    }
                }
            }
            if (Request["Debug"] + "" == "1")
            {
                this.DataGrid2.DataSource = dv.Table;
                this.DataGrid2.DataBind();
            }
            ///////////////////////////////////

            int iCount = dv.Count;

            for (int i = 0; i < iCount; i++)
            {
                string routerCode  = (String)dv[i].Row["RouterCode"];
                string description = (String)dv[i].Row["Description"];
                //Router router = (Router)ar[i];
                if (procedure.GetTask(procedure.GetRouter(routerCode).ToTaskCode).TaskType != 2)
                {
                    this.rblSelectRouter.Items.Add(new ListItem(description, routerCode));
                }
            }
            if (this.rblSelectRouter.Items.Count > 0)
            {
                this.rblSelectRouter.SelectedIndex = 0;
                this.txtSelectRouterCode.Value     = this.rblSelectRouter.SelectedItem.Value;
                FillUserSelect(workCase, this.rblSelectRouter.SelectedValue);
            }
            Session["WorkCaseApplicationTemp"] = workCase;
        }
コード例 #3
0
ファイル: WorkFlowBack.aspx.cs プロジェクト: riyuexing/rms
        private void LoadData()
        {
            string code     = Request["ApplicationCode"] + "";
            string caseCode = Request["CaseCode"] + "";

            string procedureCode = Request["ProcedureCode"] + "";
            string procedureName = Request["ProcedureName"] + "";
            //if ( procedureCode == "" )
            //	procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName);

            bool   isNew    = (caseCode == "");
            string userCode = Request["UserCode"] + "";
            string unitCode = Request["UnitCodeCode"] + "";

            this.ProjectCode = Request["ProjectCode"] + "";

            Procedure procedure      = DefinitionManager.GetProcedureDifinition(procedureCode, true);
            string    currentActCode = Request["ActCode"] + "";
            Act       currentAct     = null;
            string    actCode        = "";
            WorkCase  workCase       = null;

            if (isNew)
            {
                workCase   = Rms.WorkFlow.WorkCaseManager.StartNewWorkCase(code, procedureCode, userCode, unitCode, ref actCode, "", "");
                currentAct = (Act)(WorkCaseManager.GetActivityAct(workCase)[0]);
            }
            else
            {
                workCase   = Rms.WorkFlow.WorkCaseManager.GetWorkCase(caseCode);
                currentAct = workCase.GetAct(Request["ActCode"] + "");
            }

            //this.ChkShow.Checked = (currentAct.IsSleep == 1);
            //this.FlowOpinion.Value="不同意";
            System.Collections.IDictionaryEnumerator ie = workCase.GetOpinionEnumerator();
            while (ie.MoveNext())
            {
                Opinion Flowopinion = (Opinion)ie.Value;
                if (Flowopinion.ApplicationCode == currentAct.ActCode)
                {
                    this.FlowOpinion.Value = Flowopinion.OpinionText;
                    switch (this.up_sPMName.ToLower())
                    {
                    case "shimaopm":
                        if (Flowopinion.OpinionText.Trim() == "")
                        {
                            Task firstTask = DefinitionManager.GetFirstTask(procedure);
                            if (currentAct.ToTaskCode == firstTask.TaskCode)
                            {
                                this.FlowOpinion.Value = "";
                            }
                            else
                            {
                                this.FlowOpinion.Value = "不同意";
                            }
                            //this.FlowOpinion.Value = "不同意";
                        }
                        break;
                    }
                }
            }

            this.txtCurrentActCode.Value = currentAct.ActCode;

            Task currentTask = procedure.GetTask(currentAct.ToTaskCode);

            this.txtProcedureCode.Value   = procedureCode;
            this.txtCurrentTaskCode.Value = currentTask.TaskCode;


            DataSet ds = Rms.WorkFlow.WorkCaseManager.SaveWorkCaseData(workCase);
            //BLL.ConvertRule.GetDistinct(ds.Tables["WorkFlowAct"],"FromTaskCode","");
            //BLL.ConvertRule.DataTableDistinctRow(ds.Tables["WorkFlowAct"],"FromTaskCode");
            //BLL.ConvertRule.DataTableDistinctRow(ds.Tables["WorkFlowAct"],"FromTaskCode");
            //DataView dv = new DataView( ds.Tables["WorkFlowAct"],String.Format(" ToTaskCode='{0}' and ActType <> 1 and Copy <> 1",currentTask.TaskCode),"",DataViewRowState.CurrentRows);
            //clm修改 日期:2006-11-2
            DataView dv = new DataView(ds.Tables["WorkFlowAct"], String.Format(" ToTaskCode='{0}' and Copy <> 1", currentTask.TaskCode), "", DataViewRowState.CurrentRows);

            dv = BLL.ConvertRule.GetDistinct(dv, "FromTaskCode");


            if (Request["Debug"] + "" == "1")
            {
                this.DataGrid1.DataSource = dv;
                this.DataGrid1.DataBind();
            }

            int iCount = dv.Count;

            for (int i = 0; i < iCount; i++)
            {
                string FromTaskCode = (String)dv[i].Row["FromTaskCode"];
                string FromTaskName = "退回给" + procedure.GetTask(FromTaskCode).TaskName;
                if (procedure.GetTask(FromTaskCode).TaskType != 1)
                {
                    this.rblSelectRouter.Items.Add(new ListItem(FromTaskName, FromTaskCode));
                }
            }
            if (this.rblSelectRouter.Items.Count > 0)
            {
                this.rblSelectRouter.SelectedIndex = 0;
                this.txtSelectRouterCode.Value     = this.rblSelectRouter.SelectedItem.Value;
                FillUserSelect(workCase, this.rblSelectRouter.SelectedValue);
            }
            Session["WorkCaseApplicationTemp"] = workCase;
        }