private void BindList(WF_NOTIFIER_TPL condObj)
    {
        if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ�����������������
            condObj.af_PageBy(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Order.Desc);

        #region//����Ȩ������

        #endregion
        //condObj.PID = decimal.Parse(pid);

        listObj = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Select(valObj, condObj);
        repList.DataSource = listObj;
        repList.DataBind();
    }
Esempio n. 2
0
    private void BindList(WF_NOTIFIER_TPL condObj)
    {
        if (condObj.af_PageByAttributeItem == null)//如果不存在用户定义的分页排序属性,则用主键属性排序
        {
            condObj.af_PageBy(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Order.Desc);
        }

        #region//数据权限条件

        #endregion
        //condObj.PID = decimal.Parse(pid);

        listObj = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Select(valObj, condObj);

        repList.DataSource = listObj;
        repList.DataBind();
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title      = valObj._ZhName + "编辑";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["NOTIFIER_ID"]))
        {
            keyid = Request["NOTIFIER_ID"];
        }
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["STEP_ID"]))
        {
            stepid = int.Parse(Request["STEP_ID"]);
        }
        else
        {
            Response.Write("非法连接!");
            Response.End();
        }

        if (!IsPostBack)
        {
            txtSTATUS.Items.AddRange(FormHelper.GetListItem(WF_NOTIFIER_TPL.Attribute.STATUS));

            Sys_User_Level condl = new Sys_User_Level();
            condl._CompanyId = Convert.ToInt32(userBase.OrgID);
            SelLevel.Items.AddRange(FormHelper.GetListItem(Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NAME, null, condl));

            SelLeaderLevel.Items.AddRange(FormHelper.GetListItem(Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NAME, null, condl));
            //txtNOTIFIER_TYPE.Items.AddRange(FormHelper.GetListItem(WF_NOTIFIER_TPL.Attribute.NOTIFIER_TYPE));
            if (txtSTATUS.Items.Count > 1)
            {
                txtSTATUS.SelectedIndex = 1;
            }
            //if (txtNOTIFIER_TYPE.Items.Count > 1)
            //{
            //    txtNOTIFIER_TYPE.SelectedIndex = 1;
            //}
            //while (txtNOTIFIER_TYPE.Items.Count > 4)
            //{
            //    txtNOTIFIER_TYPE.Items.RemoveAt(txtNOTIFIER_TYPE.Items.Count - 1);
            //}

            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).GetRowData(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, keyid);

                    if (valObj == null)
                    {
                        return;
                    }

                    if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelStaff.ToString("d"))
                    {
                        wucSelStaff1.Staff_NAME = valObj.STAFF_NAME;
                        wucSelStaff1.Staff_ID   = decimal.Parse(valObj.STAFF_ID);
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelDept.ToString("d"))
                    {
                        wucSelDept1.DEPT_NAME = valObj.STAFF_NAME;
                        wucSelDept1.DEPT_ID   = valObj.STAFF_ID.ToString();
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelHRole.ToString("d"))
                    {
                        wucSelStation1.STATION_NAME = valObj.STAFF_NAME;
                        wucSelStation1.STATION_ID   = valObj.STAFF_ID.ToString();
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLevel.ToString("d"))
                    {
                        SelLevel.Value = valObj.STAFF_ID.ToString();
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLeaderLevel.ToString("d"))
                    {
                        SelLeaderLevel.Value = valObj.STAFF_ID.ToString();
                    }
                    //txtNOTIFIER_ID.Value = Convert.ToString(valObj.NOTIFIER_ID);//Convert.ToInt32

                    //txtPROCID.Value = Convert.ToString(valObj.PROCID);//Convert.ToInt32

                    //txtSTEP_ID.Value = Convert.ToString(valObj.STEP_ID);//Convert.ToInt32

                    //txtSTAFF_ID.Value = Convert.ToString(valObj.STAFF_ID);//Convert.ToDecimal

                    //t//xtSTAFF_NAME.Value = Convert.ToString(valObj.STAFF_NAME);//Convert.ToString

                    txtNOTIFIER_TYPE.Value = Convert.ToString(valObj.NOTIFIER_TYPE);//Convert.ToString

                    //txtSHOW_CONDITION.Value = Convert.ToString(valObj.CONDITION);//Convert.ToString

                    //txtSHOW_FORMULA.Value = Convert.ToString(valObj.FORMULAR);//Convert.ToString

                    txtSTATUS.Value = valObj.STATUS.ToString();
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Esempio n. 4
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            WF_NOTIFIER_TPL valObj = new WF_NOTIFIER_TPL();

            //if(txtPROCID.Value !="" )
            //    valObj.PROCID = Convert.ToInt32(txtPROCID.Value);


            //if(txtSTEP_ID.Value !="" )
            //    valObj.STEP_ID = Convert.ToInt32(txtSTEP_ID.Value);

            if (txtNOTIFIER_TYPE.Value != "")
            {
                valObj.NOTIFIER_TYPE = Convert.ToString(txtNOTIFIER_TYPE.Value);
            }

            //if(txtSTAFF_ID.Value !="" )
            //    valObj.STAFF_ID = Convert.ToDecimal(txtSTAFF_ID.Value);


            //if(txtSTAFF_NAME.Value !="" )
            //    valObj.STAFF_NAME = Convert.ToString(txtSTAFF_NAME.Value);
            if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelStaff.ToString("d"))
            {
                valObj.STAFF_ID   = wucSelStaff1.Staff_ID.ToString();
                valObj.STAFF_NAME = wucSelStaff1.Staff_NAME;
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelDept.ToString("d"))
            {
                valObj.STAFF_ID   = wucSelDept1.DEPT_ID;
                valObj.STAFF_NAME = wucSelDept1.DEPT_NAME + "[领导]";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.LeaderDirect.ToString("d"))
            {
                valObj.STAFF_NAME = "直接领导";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.LeaderInDirect.ToString("d"))
            {
                valObj.STAFF_NAME = "间接领导";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelHRole.ToString("d"))
            {
                valObj.STAFF_ID   = wucSelStation1.STATION_ID;
                valObj.STAFF_NAME = wucSelStation1.STATION_NAME;
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLevel.ToString("d"))
            {
                valObj.STAFF_ID   = SelLevel.Value;
                valObj.STAFF_NAME = SelLevel.Items[SelLevel.SelectedIndex].ToString();
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLeaderLevel.ToString("d"))
            {
                valObj.STAFF_ID   = SelLeaderLevel.Value;
                valObj.STAFF_NAME = SelLeaderLevel.Items[SelLeaderLevel.SelectedIndex].ToString();
            }

            //if(txtSHOW_CONDITION.Value !="" )
            //    valObj.CONDITION = Convert.ToString(txtSHOW_CONDITION.Value);


            //if(txtSHOW_FORMULA.Value !="" )
            //    valObj.FORMULAR = Convert.ToString(txtSHOW_FORMULA.Value);


            if (txtSTATUS.Value != "")
            {
                valObj.STATUS = Convert.ToString(txtSTATUS.Value);
            }

            if (keyid != "")
            {
                valObj.NOTIFIER_ID = Convert.ToInt32(keyid);
                count = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Update(valObj, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
            }
            else
            {
                valObj.CONDITION = "";
                valObj.FORMULAR  = "";
                valObj.STEP_ID   = stepid;
                WF_STEP_TPL stepObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);

                valObj.PROCID = stepObj.PROCID;
                valObj.WFID   = stepObj.WFID;
                count         = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Insert(valObj, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);

                keyid = valObj.NOTIFIER_ID.ToString();
            }
            if (count > 0)
            {
                StringBuilder        sbData = new StringBuilder("({valObj:''");
                List <AttributeItem> lstCol = valObj.af_AttributeItemList;
                for (int i = 0; i < lstCol.Count; i++)
                {
                    object val = valObj.GetValue(lstCol[i]);
                    if (val != null)
                    {
                        sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                    }
                }
                sbData.Append("})");

                Button btn = (Button)sender;
                if (btn.ID == "btnOK")
                {
                    if (ViewState["hadSave"] == null)
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = \"postback\";}else{window.returnValue = \"postback\";}window.close();", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Esempio n. 5
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            WF_NOTIFIER_TPL valObj = new WF_NOTIFIER_TPL();

            //if(txtPROCID.Value !="" )
            //    valObj.PROCID = Convert.ToInt32(txtPROCID.Value);

            //if(txtSTEP_ID.Value !="" )
            //    valObj.STEP_ID = Convert.ToInt32(txtSTEP_ID.Value);

            if (txtNOTIFIER_TYPE.Value != "")
                valObj.NOTIFIER_TYPE = Convert.ToString(txtNOTIFIER_TYPE.Value);

            //if(txtSTAFF_ID.Value !="" )
            //    valObj.STAFF_ID = Convert.ToDecimal(txtSTAFF_ID.Value);

            //if(txtSTAFF_NAME.Value !="" )
            //    valObj.STAFF_NAME = Convert.ToString(txtSTAFF_NAME.Value);
            if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelStaff.ToString("d"))
            {
                valObj.STAFF_ID = wucSelStaff1.Staff_ID.ToString();
                valObj.STAFF_NAME = wucSelStaff1.Staff_NAME;
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelDept.ToString("d"))
            {
                valObj.STAFF_ID = wucSelDept1.DEPT_ID;
                valObj.STAFF_NAME = wucSelDept1.DEPT_NAME+"[�쵼]";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.LeaderDirect.ToString("d"))
            {
                valObj.STAFF_NAME = "ֱ���쵼";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.LeaderInDirect.ToString("d"))
            {
                valObj.STAFF_NAME = "����쵼";
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelHRole.ToString("d"))
            {
                valObj.STAFF_ID = wucSelStation1.STATION_ID;
                valObj.STAFF_NAME = wucSelStation1.STATION_NAME;
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLevel.ToString("d"))
            {
                valObj.STAFF_ID = SelLevel.Value;
                valObj.STAFF_NAME = SelLevel.Items[SelLevel.SelectedIndex].ToString();
            }
            else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLeaderLevel.ToString("d"))
            {
                valObj.STAFF_ID = SelLeaderLevel.Value;
                valObj.STAFF_NAME = SelLeaderLevel.Items[SelLeaderLevel.SelectedIndex].ToString();
            }

            //if(txtSHOW_CONDITION.Value !="" )
            //    valObj.CONDITION = Convert.ToString(txtSHOW_CONDITION.Value);

            //if(txtSHOW_FORMULA.Value !="" )
            //    valObj.FORMULAR = Convert.ToString(txtSHOW_FORMULA.Value);

            if(txtSTATUS.Value !="" )
                valObj.STATUS = Convert.ToString(txtSTATUS.Value);

            if (keyid != "")
            {
                valObj.NOTIFIER_ID = Convert.ToInt32(keyid);
                count = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Update(valObj, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
            }
            else
            {
                valObj.CONDITION = "";
                valObj.FORMULAR = "";
                valObj.STEP_ID = stepid;
                WF_STEP_TPL stepObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID,stepid);
                valObj.PROCID = stepObj.PROCID;
                valObj.WFID = stepObj.WFID;
                count = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Insert(valObj, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
                keyid = valObj.NOTIFIER_ID.ToString();

            }
            if (count > 0)
            {
                StringBuilder sbData = new StringBuilder("({valObj:''");
                List<AttributeItem> lstCol = valObj.af_AttributeItemList;
                for (int i = 0; i < lstCol.Count; i++)
                {
                    object val = valObj.GetValue(lstCol[i]);
                    if (val != null)
                    {
                        sbData.Append(",").Append(lstCol[i].FieldName).Append(":'").Append(val.ToString()).Append("'");
                    }
                }
                sbData.Append("})");

                Button btn = (Button)sender;
                if (btn.ID == "btnOK")
                {
                    if (ViewState["hadSave"] == null)
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = \"postback\";}else{window.returnValue = \"postback\";}window.close();", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = 're';}else{window.returnValue = 're';}window.close();", true);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "�༭";
        Page.Title = title;
        if (!string.IsNullOrEmpty(Request["NOTIFIER_ID"]))
        {
            keyid = Request["NOTIFIER_ID"];
        }
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["STEP_ID"]))
        {
            stepid = int.Parse(Request["STEP_ID"]);
        }
        else {
            Response.Write("�Ƿ����ӣ�");
            Response.End();
        }

        if (!IsPostBack)
        {

            txtSTATUS.Items.AddRange(FormHelper.GetListItem(WF_NOTIFIER_TPL.Attribute.STATUS));

            Sys_User_Level condl = new Sys_User_Level();
            condl._CompanyId = Convert.ToInt32(userBase.OrgID);
            SelLevel.Items.AddRange(FormHelper.GetListItem(Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NAME, null, condl));

            SelLeaderLevel.Items.AddRange(FormHelper.GetListItem(Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NUMBER, Sys_User_Level.Attribute.LEVEL_NAME, null, condl));
            //txtNOTIFIER_TYPE.Items.AddRange(FormHelper.GetListItem(WF_NOTIFIER_TPL.Attribute.NOTIFIER_TYPE));
            if (txtSTATUS.Items.Count > 1)
            {
                txtSTATUS.SelectedIndex = 1;
            }
            //if (txtNOTIFIER_TYPE.Items.Count > 1)
            //{
            //    txtNOTIFIER_TYPE.SelectedIndex = 1;
            //}
            //while (txtNOTIFIER_TYPE.Items.Count > 4)
            //{
            //    txtNOTIFIER_TYPE.Items.RemoveAt(txtNOTIFIER_TYPE.Items.Count - 1);
            //}

            try
            {
                if (keyid != "")
                {

                    valObj = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).GetRowData(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, keyid);
                    if(valObj==null) return ;

                    if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelStaff.ToString("d"))
                    {
                        wucSelStaff1.Staff_NAME = valObj.STAFF_NAME;
                        wucSelStaff1.Staff_ID = decimal.Parse(valObj.STAFF_ID);
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelDept.ToString("d"))
                    {
                        wucSelDept1.DEPT_NAME = valObj.STAFF_NAME;
                        wucSelDept1.DEPT_ID = valObj.STAFF_ID.ToString();

                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelHRole.ToString("d"))
                    {
                        wucSelStation1.STATION_NAME = valObj.STAFF_NAME;
                        wucSelStation1.STATION_ID = valObj.STAFF_ID.ToString();

                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLevel.ToString("d"))
                    {
                        SelLevel.Value = valObj.STAFF_ID.ToString();
                    }
                    else if (valObj.NOTIFIER_TYPE == WFEnum.CheckerType.SelLeaderLevel.ToString("d"))
                    {
                        SelLeaderLevel.Value = valObj.STAFF_ID.ToString();
                    }
                    //txtNOTIFIER_ID.Value = Convert.ToString(valObj.NOTIFIER_ID);//Convert.ToInt32

                    //txtPROCID.Value = Convert.ToString(valObj.PROCID);//Convert.ToInt32

                    //txtSTEP_ID.Value = Convert.ToString(valObj.STEP_ID);//Convert.ToInt32

                    //txtSTAFF_ID.Value = Convert.ToString(valObj.STAFF_ID);//Convert.ToDecimal

                    //t//xtSTAFF_NAME.Value = Convert.ToString(valObj.STAFF_NAME);//Convert.ToString

                    txtNOTIFIER_TYPE.Value = Convert.ToString(valObj.NOTIFIER_TYPE);//Convert.ToString

                    //txtSHOW_CONDITION.Value = Convert.ToString(valObj.CONDITION);//Convert.ToString

                    //txtSHOW_FORMULA.Value = Convert.ToString(valObj.FORMULAR);//Convert.ToString

                    txtSTATUS.Value=valObj.STATUS.ToString();
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["SetToStep"] != null)
        {
            string ids    = Request["SetToStep"];
            int    stepid = int.Parse(Request["StepID"]);

            WF_STEP_TPL step = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);



            HR_STAFF cond = new HR_STAFF();
            cond.In(HR_STAFF.Attribute.STAFF_ID, ids);
            List <HR_STAFF> lst = BLLTable <HR_STAFF> .Factory(conn).Select(new HR_STAFF(), cond);

            for (int i = 0; i < lst.Count; i++)
            {
                WF_NOTIFIER_TPL val = new WF_NOTIFIER_TPL();
                val.WFID     = step.WFID;
                val.PROCID   = step.PROCID;
                val.STEP_ID  = stepid;
                val.STAFF_ID = lst[i].STAFF_ID.ToString();
                if (!BLLTable <WF_NOTIFIER_TPL> .Exists(val))
                {
                    val.NOTIFIER_TYPE = "1";

                    val.CONDITION  = "";
                    val.FORMULAR   = "";
                    val.STAFF_NAME = lst[i].STAFF_NAME;
                    val.STATUS     = "1";
                    BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Insert(val, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
                }
            }
            WF_NOTIFIER_TPL delObj1 = new WF_NOTIFIER_TPL();
            delObj1.WFID    = step.WFID;
            delObj1.PROCID  = step.PROCID;
            delObj1.STEP_ID = stepid;
            delObj1.STEP_ID = stepid;
            if (BLLTable <WF_NOTIFIER_TPL> .Count(delObj1) > lst.Count)
            {
                WF_NOTIFIER_TPL delOld = new WF_NOTIFIER_TPL();
                delOld.WFID          = step.WFID;
                delOld.PROCID        = step.PROCID;
                delOld.STEP_ID       = stepid;
                delOld.NOTIFIER_TYPE = "1";
                delOld.Where("STAFF_ID not in(" + ids + ")");
                BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Delete(delOld);
            }
        }
        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelNOTIFIER_ID"] != null)
        {
            int re = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Delete(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Request["DelNOTIFIER_ID"]);

            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录
        if (Request["DelKeyIDS"] != null)
        {
            WF_NOTIFIER_TPL cond = new WF_NOTIFIER_TPL();
            cond.In(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Request["DelKeyIDS"]);
            int re = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Delete(cond);

            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            WF_NOTIFIER_TPL val = new WF_NOTIFIER_TPL();
            val.NOTIFIER_ID = int.Parse(Request["FieldKeyID"]);
            List <AttributeItem> lstCol = val.af_AttributeItemList;
            for (int i = 0; i < lstCol.Count; i++)
            {
                if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName]))
                {
                    val.SetValue(lstCol[i].FieldName, Request["txt" + lstCol[i].FieldName]);
                }
            }

            BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Update(val, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
Esempio n. 8
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string gotoUrl = "WF_STEPManage.aspx";
        if (Request["preUrl"] != null)
        {
            gotoUrl = Request["preUrl"];
        }
        else
        {
            gotoUrl = "../ok.aspx";
        }
        int Num = Convert.ToInt32(Request["hidCondNum"]);
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i <= Num; i++)
        {
            if (!string.IsNullOrEmpty(Request["txtCond_" + i.ToString()]))
            {
                string conddata = Request["txtCond_" + i.ToString()];
                if (sb.Length > 0)
                {
                    sb.Append("|");
                }
                sb.Append(conddata);
            }
        }
        //if (Request["open"] == null)
        //{
        if (Request["setPathCond"] != null)//设置路径条件
        {
            WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
            cond.STEP_ID = int.Parse(Request["StepID"]);
            cond.NEXT_ID = int.Parse(Request["NextID"]);

            WF_STEPATH_TPL upStep = new WF_STEPATH_TPL();
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(upStep, cond);
        }
        if (from == "1")//显示步骤条件--无用
        {
            WF_STEP_TPL upStep = new WF_STEP_TPL();
            upStep.STEP_ID = keyid;
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable<WF_STEP_TPL>.Factory(conn).Update(upStep, WF_STEP_TPL.Attribute.STEP_ID);
        }
        else if (from == "2")//普通路径条件
        {
            WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
            cond.STEP_ID = keyid;
            cond.NEXT_ID = int.Parse(Request["NextID"]);
            cond.PATH_TYPE = int.Parse(Request["PATH_TYPE"]);
            WF_STEPATH_TPL upStep = new WF_STEPATH_TPL();
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(upStep, cond);
        }
        else if (from == "3")//审核人条件设置
        {
            WF_CHECKER_TPL upCh = new WF_CHECKER_TPL();
            upCh.CHECKER_ID = keyid;
            upCh.CONDITION = sb.ToString();
            if (upCh.CONDITION.Length > 1)
            {
                upCh.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upCh.FORMULAR = "";
            }
            BLLTable<WF_CHECKER_TPL>.Factory(conn).Update(upCh, WF_CHECKER_TPL.Attribute.CHECKER_ID);
        }
        else if (from == "4")//选择过程条件
        {
            WF_PROCESS_TPL upSet = new WF_PROCESS_TPL();
            upSet.PROCID = keyid;
            upSet.CONDITION = sb.ToString();
            if (upSet.CONDITION.Length > 1)
            {
                upSet.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upSet.FORMULAR = "";
            }
            BLLTable<WF_PROCESS_TPL>.Factory(conn).Update(upSet, WF_PROCESS_TPL.Attribute.PROCID);
        }
        else if (from == "5")//通知人条件设置
        {
            WF_NOTIFIER_TPL upCh = new WF_NOTIFIER_TPL();
            upCh.NOTIFIER_ID = keyid;
            upCh.CONDITION = sb.ToString();
            if (upCh.CONDITION.Length > 1)
            {
                upCh.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upCh.FORMULAR = "";
            }
            BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Update(upCh, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
        }
        //else if (from == "6")
        //{
        //    WF_STEPState upSet = new WF_STEPState();
        //    upSet.StateID = keyid;
        //    upSet.CONDITION = sb.ToString();
        //    if (upSet.CONDITION.Length > 1)
        //    {
        //        upSet.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
        //    }
        //    else
        //    {
        //        upSet.FORMULAR = "";
        //    }
        //    BLLTable<WF_STEPState>.Factory(conn).Update(upSet);
        //}

        if (Request["setpSetting"] != null)
        {
            //Response.Write(Request.Url.AbsoluteUri);
            string randStr = StringHelperExd.GetRandomCode(6);
            string url = Request.Url.AbsoluteUri;
            if (url.IndexOf("&r=") != -1)
            {
                Regex reg = new Regex(@"&r=\w+");
                url = reg.Replace(url, "&r=" + randStr);
            }
            else {
                url += "&r=" + randStr;
            }
            //Response.Write(url);
            //ScriptHelper.AlertAndGo(Page, "条件保存成功!", url);
            ScriptHelper.Alert(Page, "条件保存成功!");
            //Response.Redirect(Request.Url.AbsoluteUri);
        }
        else
        {
            AgileFrame.Core.ScriptHelper.ResponseScript(Page, "if (window.opener){window.opener.returnValue = \"ok\";}else{window.returnValue = \"ok\";}window.close();", true);
        }
        //Response.Redirect(gotoUrl);
        //}
        //else//打开条件配制窗口,无论是修改还是新增条件,都只需要返回条件和公式即可
        //{
        //    AgileFrame.Core.ScriptHelper.ResponseScript(Page, "window.returnValue=\"" + sb.ToString() + "`" + txtGongShi.Value.Trim() + "\";window.close();", false);
        //}
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["SetToStep"] != null)
        {
            string ids = Request["SetToStep"];
            int stepid = int.Parse(Request["StepID"]);

            WF_STEP_TPL step= BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID,stepid);

            HR_STAFF cond = new HR_STAFF();
            cond.In(HR_STAFF.Attribute.STAFF_ID,ids);
            List<HR_STAFF> lst = BLLTable<HR_STAFF>.Factory(conn).Select(new HR_STAFF(), cond);
            for (int i = 0; i < lst.Count; i++) {
                WF_NOTIFIER_TPL val = new WF_NOTIFIER_TPL();
                val.WFID = step.WFID;
                val.PROCID = step.PROCID;
                val.STEP_ID = stepid;
                val.STAFF_ID = lst[i].STAFF_ID.ToString();
                if (!BLLTable<WF_NOTIFIER_TPL>.Exists(val))
                {
                    val.NOTIFIER_TYPE = "1";

                    val.CONDITION = "";
                    val.FORMULAR = "";
                    val.STAFF_NAME = lst[i].STAFF_NAME;
                    val.STATUS = "1";
                    BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Insert(val, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
                }
            }
            WF_NOTIFIER_TPL delObj1=new WF_NOTIFIER_TPL();
             delObj1.WFID = step.WFID;
                delObj1.PROCID = step.PROCID;
                delObj1.STEP_ID = stepid;
            delObj1.STEP_ID=stepid;
            if (BLLTable<WF_NOTIFIER_TPL>.Count(delObj1) > lst.Count)
            {
                WF_NOTIFIER_TPL delOld = new WF_NOTIFIER_TPL();
                delOld.WFID = step.WFID;
                delOld.PROCID = step.PROCID;
                delOld.STEP_ID = stepid;
                delOld.NOTIFIER_TYPE = "1";
                delOld.Where("STAFF_ID not in(" + ids + ")");
                BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Delete(delOld);
            }
        }
        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelNOTIFIER_ID"] != null)
        {
            int re = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Delete(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Request["DelNOTIFIER_ID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            WF_NOTIFIER_TPL cond = new WF_NOTIFIER_TPL();
            cond.In(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, Request["DelKeyIDS"]);
            int re = BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Delete(cond);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }

        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            WF_NOTIFIER_TPL val = new WF_NOTIFIER_TPL();
            val.NOTIFIER_ID = int.Parse(Request["FieldKeyID"]);
            List<AttributeItem> lstCol = val.af_AttributeItemList;
            for (int i = 0; i < lstCol.Count; i++)
            {
                if (!string.IsNullOrEmpty(Request["txt" + lstCol[i].FieldName])) {
                    val.SetValue(lstCol[i].FieldName,Request["txt" + lstCol[i].FieldName]);
                }
            }

            BLLTable<WF_NOTIFIER_TPL>.Factory(conn).Update(val, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }
        Response.End();
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Convert.ToInt32(Request["KeyID"]);//3 审核人条件
        }
        if (!string.IsNullOrEmpty(Request["STEP_ID"]))
        {
            keyid = Convert.ToInt32(Request["STEP_ID"]);//2 普通路径条件
        }
        if (!string.IsNullOrEmpty(Request["StepID"]))
        {
            keyid = Convert.ToInt32(Request["StepID"]);
        }
        if (keyid == 0)
        {
            Response.Write("非法连接!");
            Response.End();
        }

        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = Convert.ToInt32(Request["WFID"]);
        }
        if (!string.IsNullOrEmpty(Request["from"]))
        {
            from = Request["from"];//2 普通路径条件 3 审核人条件
        }

        if (!IsPostBack)
        {
            //Response.Write(Request.Url.AbsoluteUri);
            if (wfid > 0)
            {
                var ocjWFC = BLLTable <WF_INFO> .Factory(conn).GetRowData(WF_INFO.Attribute.WFID, wfid);

                //afname = ocjWFC.WFName;
                //wfcname = ocjWFC.WFCNAME;

                //List<WFCondCol> lstCol = BLLTable<WFCondCol>.GetRowsList(WFCondCol.Attribute.WFName, afname);
                //for (int i = 0; i < lstCol.Count; i++)
                //{
                //    litCol1.Text += "<option value=\"" + lstCol[i].ColName + "\" title=\"" + lstCol[i].ColNote + "\">" + lstCol[i].ColCName + "</option>";
                //    litCol2.Text += "<option value=\"" + lstCol[i].ColName + "\" title=\"" + lstCol[i].ColNote + "\">" + lstCol[i].ColCName + "</option>";

                //    //ListItem li1 = new ListItem(lstCol[i].ColCName, lstCol[i].ColName);
                //    //selCol1.Items.Add(li1);

                //    //ListItem li2 = new ListItem(lstCol[i].ColCName, lstCol[i].ColName);
                //    //selCol2.Items.Add(li2);
                //}
                string colsHtml = WFAdmin.GetSelectTbColsHtmlByWFID(wfid);
                //Response.Write(colsHtml + afname);
                litCol1.Text = colsHtml;
                litCol2.Text = colsHtml;
            }


            btnBack.Attributes.Add("onclick", "window.close();return false;");
            string condStr = "";
            string formula = "";
            if (Request["setPathCond"] != null)//设置路径条件
            {
                WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
                cond.STEP_ID = int.Parse(Request["StepID"]);
                cond.NEXT_ID = int.Parse(Request["NextID"]);
                WF_STEPATH_TPL Obj = BLLTable <WF_STEPATH_TPL> .Factory(conn).GetRowData(new WF_STEPATH_TPL(), cond);

                WF_STEP_TPL ObjStep1 = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, cond.STEP_ID);

                WF_STEP_TPL ObjStep = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, cond.NEXT_ID);

                litStep.Text = ObjStep1.STEP_NAME + " 到 " + ObjStep.STEP_NAME;
                if (Obj != null)
                {
                    condStr = Obj.CONDITION;
                    formula = Obj.FORMULAR;
                }
                //Response.Write(condStr);
            }
            if (keyid > 0)
            {
                if (from == "1")//步骤显示条件--无用  chx
                {
                    WF_STEP_TPL Obj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, keyid);

                    litStep.Text = Obj.STEP_NAME;
                    if (Obj != null)
                    {
                        condStr = Obj.CONDITION;
                        formula = Obj.FORMULAR;
                    }
                }
                else if (from == "2")//普通路径条件
                {
                    //Response.Write("ddd");
                    WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
                    cond.STEP_ID   = keyid;
                    cond.NEXT_ID   = int.Parse(Request["NextID"]);
                    cond.PATH_TYPE = int.Parse(Request["PATH_TYPE"]);
                    WF_STEPATH_TPL Obj = BLLTable <WF_STEPATH_TPL> .Factory(conn).GetRowData(new WF_STEPATH_TPL(), cond);

                    WF_STEP_TPL ObjStep1 = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, keyid);

                    WF_STEP_TPL ObjStep = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, cond.NEXT_ID);

                    litStep.Text = ObjStep1.STEP_NAME + " 到 " + ObjStep.STEP_NAME;
                    if (Obj != null)
                    {
                        condStr = Obj.CONDITION;
                        formula = Obj.FORMULAR;
                    }
                }

                else if (from == "3")//审核人条件
                {
                    WF_CHECKER_TPL ObjCk = BLLTable <WF_CHECKER_TPL> .Factory(conn).GetRowData(WF_CHECKER_TPL.Attribute.CHECKER_ID, keyid);

                    if (ObjCk != null)
                    {
                        litStep.Text = ObjCk.STAFF_NAME;
                        condStr      = ObjCk.CONDITION;
                        formula      = ObjCk.FORMULAR;
                    }
                }
                else if (from == "4")//使用哪个过程条件
                {
                    WF_PROCESS_TPL recSet = BLLTable <WF_PROCESS_TPL> .Factory(conn).GetRowData(WF_PROCESS_TPL.Attribute.PROCID, keyid);

                    litStep.Text = recSet.PROC_NAME;
                    condStr      = recSet.CONDITION;
                    formula      = recSet.FORMULAR;
                }
                else if (from == "5")//通知人条件
                {
                    WF_NOTIFIER_TPL ObjCk = BLLTable <WF_NOTIFIER_TPL> .Factory(conn).GetRowData(WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID, keyid);

                    if (ObjCk != null)
                    {
                        litStep.Text = ObjCk.STAFF_NAME;
                        condStr      = ObjCk.CONDITION;
                        formula      = ObjCk.FORMULAR;
                    }
                }
                //else if (from == "6")//通知人条件
                //{
                //    WF_STEPState recSet = BLLTable<WF_STEPState>.Factory(conn).GetRowData(WF_STEPState.Attribute.StateID, keyid);
                //    litStep.Text = "可选状态条件";
                //    condStr = recSet.CONDITION;
                //    formula = recSet.FORMULAR;
                //}
            }
            //Response.Write(condStr);
            if (!string.IsNullOrEmpty(condStr))
            {
                string show = formula.Substring(0, 4);
                selIsShow.Value = show;
                string str = condStr;
                if (str.Trim() != "")
                {
                    string[] arrCond = StringHelper.GetStringArray(str, '|');
                    condNum = arrCond.Length.ToString();
                    for (int i = 0; i < arrCond.Length; i++)
                    {
                        StringBuilder sbThml = new StringBuilder("<tr id='tr_");//show:
                        int           Num    = i + 1;
                        sbThml.Append(Num).Append("'><td><span>");
                        sbThml.Append(Num).Append("</span></td><td>");
                        sbThml.Append("<input name='txtCond_").Append(Num).Append("' readonly='readonly' type='text' value='");//
                        sbThml.Append(arrCond[i]).Append("' title=\"").Append(createDataObj(arrCond[i])).Append("\" /></td><td>");
                        sbThml.Append("<a href='#' onclick='editCond(this);'>修改</a>&nbsp;&nbsp;<a href='#' onclick='delCond(this);'>删除</a></td></tr>");
                        litConds.Text += sbThml.ToString();
                    }
                }
                if (formula.Length > 5)
                {
                    txtGongShi.Value = formula.Substring(5);
                }
            }
        }
    }
Esempio n. 11
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string gotoUrl = "WF_STEPManage.aspx";

        if (Request["preUrl"] != null)
        {
            gotoUrl = Request["preUrl"];
        }
        else
        {
            gotoUrl = "../ok.aspx";
        }
        int           Num = Convert.ToInt32(Request["hidCondNum"]);
        StringBuilder sb  = new StringBuilder();

        for (int i = 1; i <= Num; i++)
        {
            if (!string.IsNullOrEmpty(Request["txtCond_" + i.ToString()]))
            {
                string conddata = Request["txtCond_" + i.ToString()];
                if (sb.Length > 0)
                {
                    sb.Append("|");
                }
                sb.Append(conddata);
            }
        }
        //if (Request["open"] == null)
        //{
        if (Request["setPathCond"] != null)//设置路径条件
        {
            WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
            cond.STEP_ID = int.Parse(Request["StepID"]);
            cond.NEXT_ID = int.Parse(Request["NextID"]);

            WF_STEPATH_TPL upStep = new WF_STEPATH_TPL();
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable <WF_STEPATH_TPL> .Factory(conn).Update(upStep, cond);
        }
        if (from == "1")//显示步骤条件--无用
        {
            WF_STEP_TPL upStep = new WF_STEP_TPL();
            upStep.STEP_ID   = keyid;
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable <WF_STEP_TPL> .Factory(conn).Update(upStep, WF_STEP_TPL.Attribute.STEP_ID);
        }
        else if (from == "2")//普通路径条件
        {
            WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
            cond.STEP_ID   = keyid;
            cond.NEXT_ID   = int.Parse(Request["NextID"]);
            cond.PATH_TYPE = int.Parse(Request["PATH_TYPE"]);
            WF_STEPATH_TPL upStep = new WF_STEPATH_TPL();
            upStep.CONDITION = sb.ToString();
            if (upStep.CONDITION.Length > 1)
            {
                upStep.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upStep.FORMULAR = "";
            }
            BLLTable <WF_STEPATH_TPL> .Factory(conn).Update(upStep, cond);
        }
        else if (from == "3")//审核人条件设置
        {
            WF_CHECKER_TPL upCh = new WF_CHECKER_TPL();
            upCh.CHECKER_ID = keyid;
            upCh.CONDITION  = sb.ToString();
            if (upCh.CONDITION.Length > 1)
            {
                upCh.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upCh.FORMULAR = "";
            }
            BLLTable <WF_CHECKER_TPL> .Factory(conn).Update(upCh, WF_CHECKER_TPL.Attribute.CHECKER_ID);
        }
        else if (from == "4")//选择过程条件
        {
            WF_PROCESS_TPL upSet = new WF_PROCESS_TPL();
            upSet.PROCID    = keyid;
            upSet.CONDITION = sb.ToString();
            if (upSet.CONDITION.Length > 1)
            {
                upSet.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upSet.FORMULAR = "";
            }
            BLLTable <WF_PROCESS_TPL> .Factory(conn).Update(upSet, WF_PROCESS_TPL.Attribute.PROCID);
        }
        else if (from == "5")//通知人条件设置
        {
            WF_NOTIFIER_TPL upCh = new WF_NOTIFIER_TPL();
            upCh.NOTIFIER_ID = keyid;
            upCh.CONDITION   = sb.ToString();
            if (upCh.CONDITION.Length > 1)
            {
                upCh.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
            }
            else
            {
                upCh.FORMULAR = "";
            }
            BLLTable <WF_NOTIFIER_TPL> .Factory(conn).Update(upCh, WF_NOTIFIER_TPL.Attribute.NOTIFIER_ID);
        }
        //else if (from == "6")
        //{
        //    WF_STEPState upSet = new WF_STEPState();
        //    upSet.StateID = keyid;
        //    upSet.CONDITION = sb.ToString();
        //    if (upSet.CONDITION.Length > 1)
        //    {
        //        upSet.FORMULAR = selIsShow.Value + ":" + txtGongShi.Value.Trim();
        //    }
        //    else
        //    {
        //        upSet.FORMULAR = "";
        //    }
        //    BLLTable<WF_STEPState>.Factory(conn).Update(upSet);
        //}

        if (Request["setpSetting"] != null)
        {
            //Response.Write(Request.Url.AbsoluteUri);
            string randStr = StringHelperExd.GetRandomCode(6);
            string url     = Request.Url.AbsoluteUri;
            if (url.IndexOf("&r=") != -1)
            {
                Regex reg = new Regex(@"&r=\w+");
                url = reg.Replace(url, "&r=" + randStr);
            }
            else
            {
                url += "&r=" + randStr;
            }
            //Response.Write(url);
            //ScriptHelper.AlertAndGo(Page, "条件保存成功!", url);
            ScriptHelper.Alert(Page, "条件保存成功!");
            //Response.Redirect(Request.Url.AbsoluteUri);
        }
        else
        {
            AgileFrame.Core.ScriptHelper.ResponseScript(Page, "if (window.opener){window.opener.returnValue = \"ok\";}else{window.returnValue = \"ok\";}window.close();", true);
        }
        //Response.Redirect(gotoUrl);
        //}
        //else//打开条件配制窗口,无论是修改还是新增条件,都只需要返回条件和公式即可
        //{
        //    AgileFrame.Core.ScriptHelper.ResponseScript(Page, "window.returnValue=\"" + sb.ToString() + "`" + txtGongShi.Value.Trim() + "\";window.close();", false);
        //}
    }