protected void Page_Load(object sender, EventArgs e)
 {
     WX.Flow.Model.Form.MODEL fm = WX.Request.rForm;
     if (fm != null)
     {
         WX.Flow.FormFieldCollection ffedit = new WX.Flow.FormFieldCollection();
         //ffedit.Add(new WX.Flow.FormField("DATA_1", "item10"));
         //ffedit.Add(new WX.Flow.FormField("DATA_2", "item8"));
         //ffedit.Add(new WX.Flow.FormField("DATA_3", "item9"));
         WX.Flow.FormFieldCollection ffhidden = new WX.Flow.FormFieldCollection();
         //ffhidden.Add(new WX.Flow.FormField("DATA_1", "item7"));
         //ffhidden.Add(new WX.Flow.FormField("DATA_2", "item8"));
         //ffhidden.Add(new WX.Flow.FormField("DATA_3", "item9"));
         if (Request["sub_add"] != null && Request["sub_add"] != "")
         {
             WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
             foreach (WX.Flow.FormField ff in fm.Items_FormFieldCollection)
             {
                 ff.Value = Request[ff.Id] == null ? "" : Request[ff.Id];
                 ffc.Add(ff);
             }
             fm.Items_FormFieldCollection = ffc;
             Literal1.Text = fm.GenerateHtmls(ffc, ffedit, ffhidden, "").Replace("-SYS_IP-", getIp());
         }
         else
         {
             Literal1.Text = fm.GenerateHtmls(fm.Items_FormFieldCollection, ffedit, ffhidden, "").Replace("-SYS_IP-", getIp());
         }
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     WX.Flow.Model.Form.MODEL fm = null;
     if (!IsPostBack && Request["FORM_CONTENT"] != null && Request["FORM_CONTENT"] != "")
     {
         fm.Module.value       = Request["FORM_CONTENT"].Replace("&lt;", "<").Replace("&gt;", ">").Replace("&amp;", "&");
         fm.Module_Short.value = fm.GetShortModule();
         fm.UpdateItems();
         Session["formmodel"] = fm;
     }
     else
     {
         fm = (WX.Flow.Model.Form.MODEL)Session["formmodel"];
     }
     WX.Flow.FormFieldCollection oldffc = fm.FetchItems();
     WX.Flow.FormFieldCollection ffedit = new WX.Flow.FormFieldCollection();
     //ffedit.Add(new WX.Flow.FormField("DATA_1", "item10"));
     //ffedit.Add(new WX.Flow.FormField("DATA_2", "item8"));
     //ffedit.Add(new WX.Flow.FormField("DATA_3", "item9"));
     WX.Flow.FormFieldCollection ffhidden = new WX.Flow.FormFieldCollection();
     //ffhidden.Add(new WX.Flow.FormField("DATA_1", "item7"));
     //ffhidden.Add(new WX.Flow.FormField("DATA_2", "item8"));
     //ffhidden.Add(new WX.Flow.FormField("DATA_3", "item9"));
     if (Request["sub_add"] != null && Request["sub_add"] != "")
     {
         WX.Flow.FormFieldCollection ffc = new WX.Flow.FormFieldCollection();
         foreach (WX.Flow.FormField ff in oldffc)
         {
             ff.Value = Request[ff.Id] == null?"":Request[ff.Id];
             ffc.Add(ff);
         }
         fm.Items_FormFieldCollection = ffc;
         Session["formmodel"]         = fm;
         Literal1.Text = fm.GenerateHtmls(ffc, ffedit, ffhidden, "").Replace("-SYS_IP-", getIp());
     }
     else
     {
         Literal1.Text = fm.GenerateHtmls(oldffc, ffedit, ffhidden, "").Replace("-SYS_IP-", getIp());
     }
 }
        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();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["TrainID"] != null && Request["TrainID"] != "")
                {
                    WX.XZ.Train.MODEL trainmodel = WX.XZ.Train.NewDataModel(Request["TrainID"]);
                    li_title.Text           = trainmodel.Title.ToString();
                    drop_type.SelectedValue = trainmodel.Type.ToString();
                    li_addr.Text            = trainmodel.Addr.ToString();
                    li_runtime.Text         = trainmodel.RunTime.ToString();
                    li_usersname.Text       = trainmodel.UsersName.ToString();
                    li_content.Text         = trainmodel.Content.ToString();
                    string userid = WX.Main.CurUser.UserID;
                    if (Request["UserID"] != null && Request["UserID"] != "")
                    {
                        userid = Request["UserID"];
                    }
                    WX.XZ.TrainUsers.MODEL tusermodel = WX.XZ.TrainUsers.GetModelToTrainID(trainmodel.ID.ToInt32(), userid);
                    if (tusermodel != null)
                    {
                        if (tusermodel.RunID.ToString() != "")
                        {
                            WX.Flow.Model.Run.MODEL runmodel = WX.Flow.Model.Run.GetModel("select * from FL_Run where Id=" + tusermodel.RunID.ToString());
                            //2.装载Form表单
                            runmodel.LoadMyForm(false);
                            li_formcontent.Text = runmodel.GenerateHtmls(runmodel.Id.ToInt32());
                        }
                        else if (trainmodel.FlowID.ToString() != "")
                        {
                            WX.Flow.Model.Flow.MODEL    flow      = WX.Flow.Model.Flow.GetCache(trainmodel.FlowID.ToInt32());
                            WX.Flow.Model.Form.MODEL    formmodel = WX.Flow.Model.Form.NewDataModel(flow.FormId);
                            WX.Flow.FormFieldCollection ffedit    = new WX.Flow.FormFieldCollection();
                            WX.Flow.FormFieldCollection ffhidden  = new WX.Flow.FormFieldCollection();
                            li_formcontent.Text = formmodel.GenerateHtmls(formmodel.Items_FormFieldCollection, ffedit, ffhidden, WX.Main.CurUser.UserID).Replace("-SYS_IP-", getIp());

                            if (Request["UserID"] == null || Request["UserID"].ToString() == "")
                            {
                                Button1.Visible = true;
                                if (tusermodel.State.ToInt32() == 0)
                                {
                                    tusermodel.State.value = 1;
                                    tusermodel.Update();
                                }
                            }
                        }
                        if (Request["UserID"] == null || Request["UserID"].ToString() == "")
                        {
                            try
                            {
                                WX.Main.MessageToHistory_where(String.Format("SendToUserId='{0}' and RedirectToUrl like'%?TrainID={1}%'", WX.Main.CurUser.UserID, Request["TrainID"]));
                            }
                            catch
                            {
                            }
                        }
                        if (li_formcontent.Text != "")
                        {
                            Literal1.Text = "学习心得";
                        }
                    }
                }
            }
        }