protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (!IsPostBack)
     {
         WX.Flow.Model.Flow.MODEL flowmodel = WX.Flow.Model.Flow.GetCache(Convert.ToInt32(Request["flowid"])); //WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + Request["flowid"]);
         flowmodel.LoadForm(false);
         WX.Flow.Model.Form.MODEL    formmodel = flowmodel.Form;                                               //WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + flowmodel.FormId.value.ToString());
         WX.Flow.FormFieldCollection ffc       = formmodel.Items_FormFieldCollection;
         if (ffc != null)
         {
             foreach (WX.Flow.FormField ff in ffc)
             {
                 select1.Items.Add(new ListItem(ff.Text, ff.Id));
             }
         }
         WX.Flow.Model.Process.MODEL model = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])); //WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
         Literal1.Text = model.StepNo.value + ":" + model.Name.value;
         WX.Flow.FormFieldCollection edit = model.Editable_FormFieldCollection;
         if (edit != null)
         {
             foreach (WX.Flow.FormField ff in edit)
             {
                 select2.Items.Add(new ListItem(ff.Text, ff.Id));
                 select1.Items.Remove(select1.Items.FindByValue(ff.Id));
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.A_Edit)
            {
                Response.Write("你没有权限访问此功能!");
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                WX.Flow.Model.Flow.MODEL flow = WX.Flow.Model.Flow.GetCache(Convert.ToInt32(Request["flowId"]));//WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + Request["flowId"]);
                if (flow != null)
                {
                    flow.LoadForm(false);
                    fm = flow.Form;// WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + flow.FormId.value);
                    ITEM_VALUE2.Items.Add(new ListItem("常量", ""));
                    if (fm.Items_FormFieldCollection != null)
                    {
                        foreach (WX.Flow.FormField ff in fm.Items_FormFieldCollection)
                        {
                            ListItem li = new ListItem();
                            li.Text  = ff.Text;
                            li.Value = "@" + ff.Text;
                            ITEM_NAME.Items.Add(li);
                            ITEM_VALUE2.Items.Add(li);
                        }
                    }
                    DataTable dt = ULCode.QDA.XSql.GetDataTable("SELECT [Name],[Title],[Value],[Type] FROM [TE_VarDefine]");
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ListItem li = new ListItem();
                        li.Text  = "[" + dt.Rows[i]["title"].ToString() + "]";
                        li.Value = "[" + dt.Rows[i]["title"].ToString() + "]";
                        ITEM_VALUE2.Items.Add(li);
                        li.Value = "[" + dt.Rows[i]["title"].ToString() + "]";
                        ITEM_NAME.Items.Add(li);
                    }
                    WX.Flow.Model.Process.MODEL prcs = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
                    if (prcs != null)
                    {
                        if (prcs.Condition_In.value != null && prcs.Condition_In.value.ToString() != "")
                        {
                            string[] inarray    = prcs.Condition_In.value.ToString().Split('|');
                            string[] prcsinlist = inarray[0].Split(new string[] { "\n" }, StringSplitOptions.None);
                            for (int i = 0; i < prcsinlist.Length; i++)
                            {
                                if (prcsinlist[i].Trim() != "")
                                {
                                    prcsinstr += String.Format("<tr class=\"TableLine1\">\n" +
                                                               "            <td align=\"center\">[{0}]</td>" +
                                                               "            <td>{1}</td>" +
                                                               "            <td align=\"center\">" +
                                                               "              <image style=\"cursor:pointer\" src=\"/images/edit.gif\" align=\"absmiddle\" onclick=\"upedit(this,1);\">" +
                                                               "              <image style=\"cursor:pointer\" src=\"/images/delete.gif\" align=\"absmiddle\" onclick=\"delRule(this,1)\">" +
                                                               "            </td>" +
                                                               "           </tr>     ", (i + 1).ToString(), prcsinlist[i].Replace("`", "'"));
                                }
                            }
                            PRCS_IN_SET.Value  = inarray[1];
                            PRCS_IN_DESC.Value = inarray[2];
                        }
                        if (prcs.Condition_Out.value != null && prcs.Condition_Out.value.ToString() != "")
                        {
                            string[] outarray    = prcs.Condition_Out.value.ToString().Split('|');
                            string[] prcsoutlist = outarray[0].Split(new string[] { "\n" }, StringSplitOptions.None);
                            for (int i = 0; i < prcsoutlist.Length; i++)
                            {
                                if (prcsoutlist[i].Trim() != "")
                                {
                                    prcsoutstr += String.Format("<tr class=\"TableLine1\">\n" +
                                                                "            <td align=\"center\">[{0}]</td>" +
                                                                "            <td>{1}</td>" +
                                                                "            <td align=\"center\">" +
                                                                "              <image style=\"cursor:pointer\" src=\"/images/edit.gif\" align=\"absmiddle\" onclick=\"upedit(this,0)\">" +
                                                                "              <image style=\"cursor:pointer\" src=\"/images/delete.gif\" align=\"absmiddle\" onclick=\"delRule(this,0)\">" +
                                                                "            </td>" +
                                                                "           </tr>     ", (i + 1).ToString(), prcsoutlist[i].Replace("`", "'"));
                                }
                            }
                            PRCS_OUT_SET.Value  = outarray[1];
                            PRCS_OUT_DESC.Value = outarray[2];
                        }
                    }
                }

                /*
                 * WX.Flow.Model.Process.MODEL prcsmodel = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request.QueryString["Id"])) ;//WX.Flow.Model.Process.GetModel("select * from FL_Process where ID=" + Request["id"]);
                 * if (prcsmodel.Condition_In.value != null)
                 * {
                 *  Response.Write("转入:" + checkin(prcsmodel.Condition_In.value.ToString().Replace("`", "'")) + "<br/>");
                 * }
                 * if (prcsmodel.Condition_Out.value != null)
                 * {
                 *  Response.Write("转出:" + checkin(prcsmodel.Condition_Out.value.ToString().Replace("`", "'")));
                 * }*/
            }


            //if (prcsmodel != null)
            //{
            //    object obj = ULCode.QDA.XSql.GetValue("select top 1 ID from FL_Process where " + checkin(prcsmodel.Condition_In.value.ToString().Replace("`", "'")));
            //    if (obj != null)
            //    {
            //        Response.Write("正在进入流程。。。。。");
            //    }
            //    else
            //    {
            //        Response.Write(prcsmodel.Condition_In.value.ToString().Split('|')[2]);
            //    }
            //    object objout = ULCode.QDA.XSql.GetValue("select top 1 ID from FL_Process where " + checkin(prcsmodel.Condition_Out.value.ToString().Replace("`", "'")));
            //    if (objout != null)
            //    {
            //        Response.Write("正在转出流程。。。。。");
            //    }
            //    else
            //    {
            //        Response.Write(prcsmodel.Condition_In.value.ToString().Split('|')[2]);
            //    }
            //}
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Master.A_Edit)
     {
         Response.Write("你没有权限访问此功能!");
         Response.End();
         return;
     }
     if (Request["flowid"] != null)
     {
         try
         {
             fid = Convert.ToInt32(Request["flowid"]);
         }
         catch { }
         if (!IsPostBack)
         {
             WX.Flow.Model.Flow.MODEL model = WX.Flow.Model.Flow.GetCache(fid); //WX.Flow.Model.Flow.GetModel("select * from FL_Flows where ID=" + fid);
             if (model != null)
             {
                 model.LoadForm(false);
                 WX.Flow.Model.Form.MODEL formmodel = model.Form; //WX.Flow.Model.Form.GetModel("select * from FL_Forms where ID=" + model.FormId.value);
                 foreach (WX.Flow.FormField ff in formmodel.Items_FormFieldCollection)
                 {
                     drop_items.Items.Add(new ListItem(ff.Text, ff.Id));
                 }
             }
             //DataTable dt = ULCode.QDA.XSql.GetDataTable("select Name,StepNo from FL_Process where FlowId=" + fid);
             //for (int i = 0; i < dt.Rows.Count; i++)
             model.LoadProcessList(false);
             if (model.ProcessList != null)
             {
                 foreach (WX.Flow.Model.Process.MODEL prcs in model.ProcessList)
                 {
                     AUTO_PRCS_USER.Items.Add(new ListItem(prcs.Name.ToString(), prcs.StepNo.ToString()));
                 }
             }
             AUTO_PRCS_USER.SelectedValue = Request["id"];
             WX.Flow.Model.Process.MODEL procss = WX.Flow.Model.Process.GetCache(Convert.ToInt32(Request["id"]));//WX.Flow.Model.Process.GetModel("select * from FL_Process where Id="+Request["id"]);
             if (procss != null)
             {
                 WX.Data.Dict.BindListCtrl_enum_AutoOpMode(this.TOP_DEFAULT, null, null, procss.Auto_OPMode.ToString());
                 USER_LOCK.SelectedValue = procss.Auto_OpChangeMode.ToString();
                 WX.Data.Dict.BindListCtrl_enum_AutoSelOpFilter(this.USER_FILTER, null, null, procss.Auto_FilterMode.ToString());
                 WX.Data.Dict.BindListCtrl_enum_AutoSelOpType(this.AUTO_TYPE, null, null, procss.Auto_Type.ToString());
                 AUTO_PRCS_USER.SelectedValue = procss.Auto_BaseUnit.ToString();
                 drop_items.SelectedValue     = procss.Auto_Item.ToString();
                 AUTO_USER.Value = procss.Auto_UserList.ToString();
                 if (procss.Auto_UserList.ToString() != "")
                 {
                     AUTO_USER_NAME.Text = ULCode.QDA.XSql.GetXDataTable("SELECT RealName FROM TU_Employees WHERE UserID in('" + procss.Auto_UserList.ToString().Replace(",", "','") + "')").ToColValueList();
                 }
                 AUTO_USER_OP.Value = procss.Auto_UserOP.ToString();
                 if (procss.Auto_UserOP.ToString() != "")
                 {
                     AUTO_USER_OP_NAME.Text = ULCode.QDA.XSql.GetXDataTable("SELECT RealName FROM TU_Employees WHERE UserID in('" + procss.Auto_UserOP.ToString().Replace(",", "','") + "')").ToColValueList();
                 }
             }
         }
     }
 }