예제 #1
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;
        }
예제 #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                ///////////////////////////////////////////////////
                string code          = Request["ApplicationCode"] + "";
                string caseCode      = Request["CaseCode"] + "";
                string procedureCode = Request["ProcedureCode"] + "";
                string procedureName = Request["ProcedureName"] + "";
                string userCode      = Request["UserCode"] + "";
                string unitCode      = Request["UnitCodeCode"] + "";
                this.ProjectCode = Request["ProjectCode"] + "";
                //if (procedureCode == "")
                //    procedureCode = BLL.WorkFlowRule.GetProcedureCodeByName(procedureName);
                bool      isNew          = (caseCode == "");
                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.txtCurrentActCode.Value = currentAct.ActCode;
                Task currentTask = procedure.GetTask(currentAct.ToTaskCode);
                ///////////////////////////////////////////////////

                if (currentTask.CanManual == 1)
                {
                    this.SendTable.Visible    = false;
                    this.SendTitle.Visible    = false;
                    this.CopyTable.Visible    = false;
                    this.CopyTitle.Visible    = false;
                    this.OpinionTitle.Visible = false;
                    this.OpinionTable.Visible = false;
                    this.MessageTitle.Visible = false;
                    this.MessageTable.Visible = false;
                    this.ButtonTable.Visible  = false;
                    this.pwdcheckdiv.Visible  = true;
                }
                else
                {
                    InitPageState();
                }
                BLL.TemplateOpinion to = new BLL.TemplateOpinion();
                to.UserCode = ((User)Session["User"]).UserCode;
                DataTable dt = to.GetTemplateOpinions();
                if (dt.Rows.Count == 0)
                {
                    this.sltTemplateOpinion.Visible = false;
                }
                else
                {
                    this.sltTemplateOpinion.Visible        = true;
                    this.sltTemplateOpinion.DataSource     = dt;
                    this.sltTemplateOpinion.DataTextField  = "Name";
                    this.sltTemplateOpinion.DataValueField = "Center";
                    this.sltTemplateOpinion.DataBind();
                    ListItem li = new ListItem();
                    li.Text     = "--常用意见--";
                    li.Value    = "";
                    li.Selected = true;
                    this.sltTemplateOpinion.Items.Add(li);
                    this.sltTemplateOpinion.Attributes["onchange"] = "javascript:document.all('FlowOpinion').value = this.value;";
                }
                this.rdoCheck.Visible = (Request["IsAudit"] + "" == "1");
            }
        }
예제 #3
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"] + "";

            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;
        }