예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //进入条件
         WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
         this.FormId     = flow.FormId.ToInt32();
         MenuBar1.Param1 = this.rFlowId.ToString();
         bool b = flow.GetProcessByStep(1).GetInAccess(null);
         if (b == false)
         {
             this.btnSubmit.Enabled = false;
             this.tooltip.InnerText = flow.GetProcessByStep(1).GetInMsg(null);
         }
         //填充流程信息及新工作流水号
         flow.LoadNumberRule(false);
         string name   = flow.Name.value.ToString();
         string number = flow.NumberRule.GetValue();
         this.txtSerialNumber.Text = number; //String.Format("{0}({1})", name, number);
         this.txtDescription.Text  = flow.Description.value.ToString();
         //填充流程步骤列表
         flow.LoadProcessList(false);
         var process = flow.ProcessList;
         //var process = Process.Caches.FindAll(delegate(Process.MODEL dele) { return dele.Id.ToInt32() == rFlowId; });//WX.Flow.Model.Process.GetModels("SELECT * FROM FL_Process WHERE FlowId=" + rFlowId);
         var query = process.Select(p => new
         {
             StepNo   = p.GetFieldValue("StepNo").ToString(),
             Name     = p.GetFieldValue("Name").ToString(),
             NextNode = ShowNextNode(p.GetFieldValue("Next_Nodes").ToString())
         });
         this.ProcessRepeater.DataSource = query;
         this.ProcessRepeater.DataBind();
     }
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //进入条件
                if (Request["Flow_Id"] != null && Request["Flow_Id"] != "")
                {
                    flow            = WX.Flow.Model.Flow.GetCache(rFlowId); //WX.Flow.Model.Flow.NewDataModel(rFlowId);
                    this.FormId     = flow.FormId.ToInt32();
                    MenuBar1.Param1 = this.rFlowId.ToString();
                    bool b = flow.GetProcessByStep(1).GetInAccess(null);
                    if (b == false || flow.IsVisible.ToInt32() == 1)
                    {
                        this.btnSubmit.Enabled = false;
                        this.tooltip.InnerText = flow.GetProcessByStep(1).GetInMsg(null);
                    }
                    //填充流程信息及新工作流水号
                    flow.LoadNumberRule(false);
                    string name = flow.Name.value.ToString();

                    //表单
                    WX.Flow.Model.Form.MODEL formmodel = WX.Flow.Model.Form.NewDataModel(flow.FormId);
                    //WX.Flow.Model.Run.MODEL runmodel;
                    //runmodel = WX.Flow.Model.Run.NewDataModel();
                    //runmodel.FlowId.value = flow.Id.value;
                    ////2.装载Form表单
                    //runmodel.LoadMyFlow(false);
                    //runmodel.LoadMyForm(false);

                    WX.Flow.FormFieldCollection ffedit   = new WX.Flow.FormFieldCollection();
                    WX.Flow.FormFieldCollection ffhidden = new WX.Flow.FormFieldCollection();
                    Literal1.Text = formmodel.GenerateHtmls(formmodel.Items_FormFieldCollection, ffedit, ffhidden, WX.Main.CurUser.UserID).Replace("-SYS_IP-", getIp());
                }
                if (Request["RunID"] != null && Request["RunID"] != "")
                {
                    WX.Flow.Model.Run.MODEL runmodel;
                    runmodel        = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + Request["RunID"]);
                    MenuBar1.Param1 = runmodel.FlowId.ToString();
                    flow            = WX.Flow.Model.Flow.NewDataModel(runmodel.FlowId.ToInt32());
                    //2.装载Form表单
                    runmodel.LoadMyForm(false);
                    Literal1.Text             = runmodel.GenerateHtmls(runmodel.Id.ToInt32());
                    this.txtSerialNumber.Text = runmodel.Name.ToString(); //String.Format("{0}({1})", name, number);
                    btnSubmit.Visible         = false;
                }
                else
                {
                    this.txtSerialNumber.Text = String.Format("{0}({1})", flow.Name.ToString(), WX.Flow.Model.Run.GetFileCode(rFlowId));
                }
                this.labDescription.Text = flow.Description.value.ToString();
                //填充流程步骤列表
                System.Data.DataTable query;
                if (Request["RunID"] != null)
                {
                    query = ULCode.QDA.XSql.GetDataTable("select A.StepNo,A.Name,A.Next_Nodes,emp.RealName+':'+C.Content username from FL_Process A Left join FL_Run B on A.FlowID=B.FlowID left join FL_RunFeedBack C on B.ID=C.RunID and A.StepNo=C.StepNo left join TU_Users emp on C.CheckUserID=emp.UserId where A.FlowId=" + flow.Id.ToString() + " and B.ID=" + Request["RunID"] + " order by A.StepNo asc");
                }
                else
                {
                    query = ULCode.QDA.XSql.GetDataTable("select StepNo,Name,Next_Nodes,'' username from FL_Process where FlowId=" + flow.Id.ToString() + " order by StepNo asc");
                }
                this.ProcessRepeater.DataSource = query;
                this.ProcessRepeater.DataBind();
            }
        }