Exemple #1
0
    int delStep(string stepid)
    {
        WF_STEP_TPL obj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);

        int re = BLLTable <WF_STEP_TPL> .Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, stepid);

        if (re > 0)
        {
            WF_CHECKER_TPL cker = new WF_CHECKER_TPL();
            cker.WFID    = obj.WFID;
            cker.PROCID  = obj.PROCID;
            cker.STEP_ID = obj.STEP_ID;

            BLLTable <WF_CHECKER_TPL> .Factory(conn).Delete(cker);

            //WF_STEP_FORM_TPL stepf = new WF_STEP_FORM_TPL();
            //stepf.WFID = obj.WFID;
            //stepf.PROCID = obj.PROCID;
            //stepf.STEP_ID = obj.STEP_ID;

            //BLLTable<WF_STEP_FORM_TPL>.Factory(conn).Delete(stepf);

            WF_STEPATH_TPL stepP = new WF_STEPATH_TPL();
            stepP.WFID    = obj.WFID;
            stepP.PROCID  = obj.PROCID;
            stepP.STEP_ID = obj.STEP_ID;

            BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(stepP);

            stepP.STEP_ID = obj.STEP_ID;

            BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(stepP);
        }
        return(re);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        WF_STEP_TPL cond1 = new WF_STEP_TPL();

        step1.WFID    = wfid;
        step1.PROCID  = procid;
        step1.STEP_ID = stepid;
        WF_STEP_TPL vvv1 = new WF_STEP_TPL();

        vvv1.CONDITION = txtCONDITION.Value;
        //zlg 保存条件公式
        //if (vvv.NEXT_REAL == "2")
        vvv1.FORMULAR = txtFORMULAR.Value;
        int ret = BLLTable <WF_STEP_TPL> .Factory(conn).Update(vvv1, cond1);

        if (ret > 0)
        {
            litWarn.Text = "保存入口条件成功!" + DateTime.Now.ShowTime();
        }
        else
        {
            litWarn.Text = "保存入口条件失败!" + DateTime.Now.ShowTime();
        }

        ////没有必要?
        //WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
        //cond.WFID = wfid;
        //cond.PROCID = procid;
        //cond.STEP_ID = stepid;
        //WF_STEPATH_TPL vvv = new WF_STEPATH_TPL();
        //vvv.NEXT_REAL = txtCONDITION.Value;
        ////zlg 保存条件公式
        ////if (vvv.NEXT_REAL == "2")
        //    vvv.CONDITION = txtFORMULAR.Value;
        //int ret1 = BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(vvv, cond);
        //if (ret1 > 0)
        //{
        //    litWarn.Text = "保存入口条件成功!" + DateTime.Now.ShowTime();
        //}
        //else
        //{
        //    litWarn.Text = "保存入口条件失败!" + DateTime.Now.ShowTime();
        //}
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        WF_STEP_TPL cond1 = new WF_STEP_TPL();
        step1.WFID = wfid;
        step1.PROCID = procid;
        step1.STEP_ID = stepid;
        WF_STEP_TPL vvv1 = new WF_STEP_TPL();
        vvv1.CONDITION = txtCONDITION.Value;
        //zlg ����������ʽ
        //if (vvv.NEXT_REAL == "2")
        vvv1.FORMULAR = txtFORMULAR.Value;
        int ret = BLLTable<WF_STEP_TPL>.Factory(conn).Update(vvv1, cond1);
        if (ret > 0)
        {
            litWarn.Text = "������������ɹ���" + DateTime.Now.ShowTime();
        }
        else
        {
            litWarn.Text = "�����������ʧ�ܣ�" + DateTime.Now.ShowTime();
        }

        ////û�б�Ҫ��
        //WF_STEPATH_TPL cond = new WF_STEPATH_TPL();
        //cond.WFID = wfid;
        //cond.PROCID = procid;
        //cond.STEP_ID = stepid;
        //WF_STEPATH_TPL vvv = new WF_STEPATH_TPL();
        //vvv.NEXT_REAL = txtCONDITION.Value;
        ////zlg ����������ʽ
        ////if (vvv.NEXT_REAL == "2")
        //    vvv.CONDITION = txtFORMULAR.Value;
        //int ret1 = BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(vvv, cond);
        //if (ret1 > 0)
        //{
        //    litWarn.Text = "������������ɹ���" + DateTime.Now.ShowTime();
        //}
        //else
        //{
        //    litWarn.Text = "�����������ʧ�ܣ�" + DateTime.Now.ShowTime();
        //}
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["PREV_ID"] != null)
        {
            previd = int.Parse(Request["PREV_ID"]);
        }
        if (Request["STEP_ID"] != null)
        {
            stepid = int.Parse(Request["STEP_ID"]);
        }
        else
        {
            Response.Write("非法连接!");
            Response.End();
        }
        //Response.Write(previd.ToString());
        if (!IsPostBack)
        {
            WF_STEP_TPL valObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);

            wfid   = valObj.WFID;
            procid = valObj.PROCID;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        else
        {
            if (!string.IsNullOrEmpty(Request["PROCID"]))
            {
                procid = int.Parse(Request["PROCID"]);
                WF_PROCESS_TPL proc = BLLTable<WF_PROCESS_TPL>.GetRowData(WF_PROCESS_TPL.Attribute.PROCID, procid);
                wfid = proc.WFID;
                title += proc.PROC_NAME + "-";
            }
            else
            {
                Response.Write("非法连接!");
                Response.End();
            }
        }
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        else
        {

            List<WF_PROCESS_TPL> lstProc = BLLTable<WF_PROCESS_TPL>.Select(WF_PROCESS_TPL.Attribute.WFID, wfid);
            if (lstProc.Count > 0)
            {
                procid = lstProc[0].PROCID;
                title += lstProc[0].PROC_NAME + "-";
            }
            else
            {
                ScriptHelper.AlertAndGo(Page, "此流程未配置过程!", "../PROCESS/PROCESSManage.aspx?WFID=" + wfid);
            }
        }
        preUrl = WebHelper.GetAppPath();
        theme = preUrl + "Themes/" + BasePage._ThemeName;

        if (!IsPostBack)
        {
            string strJs = "";
            WF_STEP_TPL cond = new WF_STEP_TPL();
            cond.WFID = wfid;
            cond.PROCID = procid;

            List<WF_STEP_TPL> lstStep = BLLTable<WF_STEP_TPL>.Factory(conn).Select(new WF_STEP_TPL(), cond);

            foreach (WF_STEP_TPL step in lstStep)
            {
                if (step.STEP_TYPE == 0)
                {
                    htmlText += "<div class='node node-start' type =0 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span></div>";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "',hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                }
                else if (step.STEP_TYPE == 3)
                {
                    htmlText += "<div class='node node-end' type =3 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='active-end'><span>" + step.STEP_NAME + "</span></div></div>";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "', solidCircle, { anchors: \"TopCenter\",uuid:\'" + step.STEP_ID + "s\'  });";
                }
                else if (step.STEP_TYPE == 2)
                {
                   // htmlText += "<div class='node node-route' type =2 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='route-content'><span>" + step.STEP_NAME + "</span></div></div>";
                    htmlText += "<div class='node roate' type =2 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span></div>";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "',  solidCircle,{ anchors: \"TopCenter\",uuid:\'" + step.STEP_ID + "s\'  });";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "', hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                }
                else
                {
                    htmlText += "<div class='node node-active' type =1 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='active-content'><span>" + step.STEP_NAME + "</span></div></div>";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "',hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                    strJs += "jsPlumb.addEndpoint('" + step.STEP_ID + "', solidCircle, { anchors: \"TopCenter\" ,uuid:\'" + step.STEP_ID + "s\' });";
                }
                strJs += "jsPlumb.draggable('" + step.STEP_ID + "');";
                strJs += "doubleclick(" + step.STEP_ID + "," + step.STEP_TYPE + ");";
            }

            WF_STEPATH_TPL condP = new WF_STEPATH_TPL();
            condP.WFID = wfid;
            condP.PROCID = procid;

            List<WF_STEPATH_TPL> lstPath = BLLTable<WF_STEPATH_TPL>.Factory(conn).Select(new WF_STEPATH_TPL(), condP);
            foreach (WF_STEPATH_TPL path in lstPath)
            {
                //strJs += "jsPlumb.bind(\"connection\",function (connInfo, originalEvent) {	connInfo.connection.setLabel(\" \")});";
                strJs += "jsPlumb.connect({ uuids:[ \"" + path.STEP_ID + "e\",  \"" + path.NEXT_ID +
                            "s\"], detachable:true});";
            }
            //{uuids:["Window2BottomCenter", "Window3TopCenter"], editable:true}
            //HtmlGenericControl sss = new HtmlGenericControl();
            //sss.Attributes.Add("src", "/lib/StepCtr/StepCtr.js");
            //sss.Attributes.Add("type", "text/javascript");

            //Page.Header.Controls.AddAt(4, sss);
           // Response.Write("<script src=\"" + ResolveUrl("~/lib/jquery/jquery-1.11.1.min.js") + "\" type=\"text/javascript\"></script>");
           // Response.Write("<script src=\"" + ResolveUrl("~/lib/StepCtr/StepCtr.js") + "\" type=\"text/javascript\"></script>");

            script = "jsPlumb.ready(function () {" + strJs + "});";
           // ClientScript.RegisterStartupScript(this.GetType(), "myscript", script, true);

        }
    }
Exemple #6
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);
        //}
    }
    /// <summary>
    /// 添加新节点
    /// </summary>
    /// <returns></returns>
    private string addStep()
    {
        string strRet = "";
        WF_STEP_TPL valObj = new WF_STEP_TPL();
        try
        {
            valObj.WFID = Common.GetReqIntValue("WFID");
            valObj.STEP_NAME = Common.GetReqStrValue("STEP_NAME");
            valObj.PROCID = Common.GetReqIntValue("PROCID");
            valObj.STEP_TYPE = Common.GetReqIntValue("STEP_TYPE");
            valObj.BLOCKX = Common.GetReqIntValue("left");
            valObj.BLOCKY = Common.GetReqIntValue("top");
            //新增节点
            int count = BLLTable<WF_STEP_TPL>.Factory(conn).Insert(valObj, WF_STEP_TPL.Attribute.STEP_ID);
            if (count > 0)
            {
                strRet = valObj.STEP_ID.ToString();
            }
            else
            {
                strRet = "0";
            }
            return strRet;
        }

        catch
        {
            return "-1";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelPROCID"] != null)
        {
            if (BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.PROCID, Request["DelPROCID"]) == null)
            {

                int re = BLLTable<WF_PROCESS_TPL>.Factory(conn).Delete(WF_PROCESS_TPL.Attribute.PROCID, Request["DelPROCID"]);
                if (re > 0)
                {
                    Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
                }
                else
                {
                    Response.Write("ɾ��ʧ�ܣ�");
                }
            }
            else {
                Response.Write("����ɾ����");
            }
        }
        if (Request["DelByKeyID"] != null)
        {
            string msg = "";
            DelPROC(int.Parse(Request["WFID"]), int.Parse(Request["DelByKeyID"]), ref msg);
            Response.Write(msg);
        }

        //���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            WF_STEP_TPL cond1 = new WF_STEP_TPL();
            cond1.In(WF_STEP_TPL.Attribute.PROCID, Request["DelKeyIDS"]);
            if (!BLLTable<WF_STEP_TPL>.Exists(cond1))
            {

                WF_PROCESS_TPL cond = new WF_PROCESS_TPL();
                cond.In(WF_PROCESS_TPL.Attribute.PROCID, Request["DelKeyIDS"]);
                int re = BLLTable<WF_PROCESS_TPL>.Factory(conn).Delete(cond);
                if (re > 0)
                {
                    Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
                }
                else
                {
                    Response.Write("ɾ��ʧ�ܣ�");
                }
            }
            else
            {
                Response.Write("����ɾ����");
            }
        }

        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            WF_PROCESS_TPL val = new WF_PROCESS_TPL();
            val.PROCID = 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_PROCESS_TPL>.Factory(conn).Update(val, WF_PROCESS_TPL.Attribute.PROCID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write("111");
        //Response.End();
        //return;
        if (Request["addNewToRow"] != null)
        {
            #region//添加新节点节点---a,b和d之间插入节点c:
            //删除连接到节点c的路径[code1];删除原来 a,b和d之间的路径[code2];插入a,b和c之间,c和d之间的路径[code3]。
            //
            WF_STEP_TPL valObj = new WF_STEP_TPL();
            try
            {
                int wfid = Convert.ToInt32(Request["WFID"]);
                int procid = Convert.ToInt32(Request["PROCID"]);
                int steptype = 1;
                if (Request["STEP_TYPE"] != null)
                    steptype = Convert.ToInt32(Request["STEP_TYPE"]);

                valObj.WFID = wfid;
                if (Request["STEP_NAME"] != null)
                    valObj.STEP_NAME = Request["STEP_NAME"];
                valObj.PROCID = procid;

                valObj.STEP_TYPE = steptype;

                valObj.NOTE = "";

                valObj.CONDITION = "";
                valObj.FORMULAR = "";
                //新增节点,成功的话,再增加线段。
                int count = BLLTable<WF_STEP_TPL>.Factory(conn).Insert(valObj, WF_STEP_TPL.Attribute.STEP_ID);
                if (count > 0)
                {
                    int stepid = valObj.STEP_ID;

                    #region//code1
                    WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                    delOld.WFID = wfid;
                    delOld.PROCID = procid;
                    delOld.PATH_TYPE = 1;
                    delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                    BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(delOld);
                    #endregion

                    string previds = Request["PrevIDS"];
                    string nextids = Request["NextIDS"];
                    if (!string.IsNullOrEmpty(previds) && !string.IsNullOrEmpty(nextids))
                    {
                        string[] arr1 = StringHelper.GetStringArray(previds, ',');
                        string[] arr2 = StringHelper.GetStringArray(nextids, ',');
                        if (arr2 != null && arr1 != null)
                        {
                            if (Request["delOld"] != null)
                            {
                                #region//code2
                                //因为再节点之间插入了新节点,所以要删除 原节点之间的路径
                                WF_STEPATH_TPL delObj = new WF_STEPATH_TPL();
                                delObj.WFID = wfid;
                                delObj.PROCID = procid;
                                delObj.PATH_TYPE = 1;
                                for (int i = 0; i < arr1.Length; i++)
                                {
                                    for (int j = 0; j < arr2.Length; j++)
                                    {
                                        delObj.STEP_ID = int.Parse(arr1[i]);
                                        delObj.NEXT_ID = int.Parse(arr2[j]);

                                        BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(delObj);
                                    }
                                }
                                #endregion//
                            }
                        }
                        #region//code3
                        WF_STEPATH_TPL pathVal = new WF_STEPATH_TPL();
                        pathVal.WFID = wfid;
                        pathVal.PROCID = procid;
                        pathVal.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));

                        if (arr1 != null)
                        {
                            for (int i = 0; i < arr1.Length; i++)
                            {
                                pathVal.STEP_ID = int.Parse(arr1[i]);
                                string tp = BLLTable<WF_STEP_TPL>.Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, pathVal.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);
                                if (!string.IsNullOrEmpty(tp)) {
                                    pathVal.NODE_TYPE = int.Parse(tp);
                                }
                                pathVal.NEXT_ID = stepid;
                                if (!BLLTable<WF_STEPATH_TPL>.Exists(pathVal))
                                {
                                    pathVal.CONDITION = "";
                                    pathVal.FORMULAR = "";
                                    count += BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }

                        if (arr2 != null)
                        {
                            for (int i = 0; i < arr2.Length; i++)
                            {
                                pathVal.NODE_TYPE = steptype;
                                pathVal.STEP_ID = stepid;
                                pathVal.NEXT_ID = int.Parse(arr2[i]);
                                if (!BLLTable<WF_STEPATH_TPL>.Exists(pathVal))
                                {
                                    pathVal.CONDITION = "";
                                    pathVal.FORMULAR = "";
                                    count += BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }

                        #endregion
                    }

                    Response.Write(stepid.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }
        if (Request["UpdateStepName"] != null)//更新节点名
        {
            #region//添加节点
            try
            {
                int count = BLLTable<WF_STEP_TPL>.Factory(conn).Update(WF_STEP_TPL.Attribute.STEP_ID, Request["STEP_ID"], WF_STEP_TPL.Attribute.STEP_NAME, Request["STEP_NAME"]);
                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }

        /*
         * c节点移到a,b和d之间:
         * 删除原来连接到节点c的路径[code1];
         * 如果移动c导致a,b和c之间增加了一个步骤行,既没有移动到d所在的行,则要删除原来a,b和d之间的路径[code2]。
         * 插入a,b和c之间,c和d之间的路径[code3]。
         */
        if (Request["UpdateStepPath"] != null)//更新线段
        {
            #region//更新节点之间的路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                int wfid = Convert.ToInt32(Request["WFID"]);
                int procid = Convert.ToInt32(Request["PROCID"]);
                int stepid = Convert.ToInt32(Request["STEP_ID"]);

                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d")); ;

                string previds = Request["PrevIDS"];
                string nextids = Request["NextIDS"];

                valObj.WFID = wfid;
                valObj.PROCID = procid;
                string[] arr1 = StringHelper.GetStringArray(previds, ',');
                string[] arr2 = StringHelper.GetStringArray(nextids, ',');

                if (stepid > 0)
                {
                    #region//code1
                    WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                    delOld.WFID = wfid;
                    delOld.PROCID = procid;
                    delOld.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d")); ;
                    delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                    BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(delOld);
                    #endregion

                    if (Request["delOld"] != null)
                    {

                        if (arr1 != null && arr2 != null)
                        {
                            #region//code2
                            WF_STEPATH_TPL delObj = new WF_STEPATH_TPL();
                            delObj.WFID = wfid;
                            delObj.PROCID = procid;
                            delObj.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d")); ;
                            for (int i = 0; i < arr1.Length; i++)
                            {
                                for (int j = 0; j < arr2.Length; j++)
                                {
                                    delObj.STEP_ID = int.Parse(arr1[i]);
                                    delObj.NEXT_ID = int.Parse(arr2[j]);

                                    BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(delObj);
                                }
                            }
                            #endregion//
                        }
                    }
                    #region//code3
                    if (arr1 != null)
                    {
                        for (int i = 0; i < arr1.Length; i++)
                        {
                            valObj.STEP_ID = int.Parse(arr1[i]);
                            string tp = BLLTable<WF_STEP_TPL>.Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);
                            if (!string.IsNullOrEmpty(tp))
                            {
                                valObj.NODE_TYPE = int.Parse(tp);
                            }
                            valObj.NEXT_ID = stepid;
                            if (!BLLTable<WF_STEPATH_TPL>.Exists(valObj))
                            {
                                valObj.CONDITION = "";
                                valObj.FORMULAR = "";
                                count += BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                            }
                        }
                    }

                    if (arr2 != null)
                    {
                        for (int i = 0; i < arr2.Length; i++)
                        {
                            valObj.STEP_ID = stepid;
                            string tp = BLLTable<WF_STEP_TPL>.Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);
                            if (!string.IsNullOrEmpty(tp))
                            {
                                valObj.NODE_TYPE = int.Parse(tp);
                            }
                            valObj.NEXT_ID = int.Parse(arr2[i]);
                            if (!BLLTable<WF_STEPATH_TPL>.Exists(valObj))
                            {
                                valObj.CONDITION = "";
                                valObj.FORMULAR = "";
                                count += BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                            }
                        }
                    }

                    #endregion
                }

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }
        //添加返回路径
        if (Request["AddBackLine"] != null)
        {
            #region//添加返回路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                valObj.WFID = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.BackTo.ToString("d"));

                valObj.NEXT_ID = Convert.ToInt32(Request["NEXT_ID"]);
                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);
                string tp = BLLTable<WF_STEP_TPL>.Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);
                if (!string.IsNullOrEmpty(tp))
                {
                    valObj.NODE_TYPE = int.Parse(tp);
                }
                valObj.CONDITION = "";
                valObj.FORMULAR = "";
                count = BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }

        if (Request["GetBackNextIDS"] != null)
        {
            #region//添加返回路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {

                valObj.WFID = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.BackTo.ToString("d")); ;

                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);

                WF_STEPATH_TPL vvv = new WF_STEPATH_TPL();
                vvv.NEXT_ID = 0;
                List<WF_STEPATH_TPL> lst = BLLTable<WF_STEPATH_TPL>.Factory(conn).Select(vvv, valObj);

                //WF_STEPATH_TPL ooo = BLLTable<WF_STEPATH_TPL>.Factory(conn).GetRowData(new WF_STEPATH_TPL(WF_STEPATH_TPL.Attribute.NEXT_ID), valObj);

                if (lst != null)
                {
                    string str = "";
                    for (int i = 0; i < lst.Count; i++)
                    {
                        str += "," + lst[i].NEXT_ID;
                    }
                    Response.Write(str);
                }
                else
                {
                    //Response.Write("0");
                }
            }
            catch
            {
                //Response.Write("-1");
            }
            #endregion

        }
        if (Request["delLine"] != null)
        {
            #region//删除指定类型的路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                valObj.WFID = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = Convert.ToInt32(Request["PATH_TYPE"]);

                valObj.NEXT_ID = Convert.ToInt32(Request["NEXT_ID"]);
                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);

                count = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(valObj);

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }
        if (Request["delStep"] != null)
        {
            #region//删除节点
            WF_STEP_TPL valObj = new WF_STEP_TPL();
            try
            {
                int count = WFAdmin.delStep(Convert.ToInt32(Request["STEP_ID"]));

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }
        if (Request["delStepInPath"] != null)
        {
            #region//图形界面里删除节点
            /*
             * 删除a,b和d之间的节点c:
             * 删除原来连接到节点c的路径[code1];
             * 如果c没有兄弟节点,参数PrevIDS和NextIDS不会为空,则插入a,b和d之间的路径[code2]。
             */
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                int wfid = Convert.ToInt32(Request["WFID"]);
                int procid = Convert.ToInt32(Request["PROCID"]);
                int stepid = Convert.ToInt32(Request["STEP_ID"]);

                #region//code1
                WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                delOld.WFID = wfid;
                delOld.PROCID = procid;
                delOld.PATH_TYPE = 1;
                delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                count = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(delOld);
                #endregion

                string previds = Request["PrevIDS"];
                string nextids = Request["NextIDS"];
                if (!string.IsNullOrEmpty(previds) && !string.IsNullOrEmpty(nextids))
                {
                    valObj.WFID = wfid;
                    valObj.PROCID = procid;
                    string[] arr1 = StringHelper.GetStringArray(previds, ',');
                    string[] arr2 = StringHelper.GetStringArray(nextids, ',');

                    #region//code2

                    if (arr1 != null && arr2 != null)
                    {
                        for (int i = 0; i < arr1.Length; i++)
                        {
                            for (int j = 0; j < arr2.Length; j++)
                            {
                                valObj.STEP_ID = int.Parse(arr1[i]);
                                string tp = BLLTable<WF_STEP_TPL>.Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);
                                if (!string.IsNullOrEmpty(tp))
                                {
                                    valObj.NODE_TYPE = int.Parse(tp);
                                }
                                valObj.NEXT_ID = int.Parse(arr2[j]);
                                valObj.PATH_TYPE = 1;
                                if (!BLLTable<WF_STEPATH_TPL>.Exists(valObj))
                                {
                                    valObj.CONDITION = "";
                                    valObj.FORMULAR = "";
                                    count += BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }
                    }

                    #endregion
                }

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion

        }
        Response.End();
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "�༭ ";

        if (!string.IsNullOrEmpty(Request["STEP_ID"]))
        {
            keyid = Request["STEP_ID"];
        }
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            keyid = Request["KeyID"];
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);

            if (ViewState["PROCID"] != null) {
                procid = Convert.ToInt32(ViewState["PROCID"]);
            }

        }
        if (procid > 0)
        {
            if (wfid == 0)
            {
                WF_PROCESS_TPL pvalue = BLLTable<WF_PROCESS_TPL>.Factory(conn).GetRowData(WF_PROCESS_TPL.Attribute.PROCID, procid);
                title += pvalue.PROC_NAME + "-";
                wfid = pvalue.WFID;
            }
        }
        else {
            if (keyid == "")
            {
                Response.Write("�Ƿ����ӣ�");
                Response.End();
            }

        }
        if (!IsPostBack)
        {

            if (!string.IsNullOrEmpty(Request["pathset"]))
            {
                btnSave.Enabled = false;

            }
            txtWFCID.Value = wfid.ToString();
            txtPROCID.Value = procid.ToString();

            txtBACK_TYPE.Items.AddRange(FormHelper.GetListItem(WF_STEP_TPL.Attribute.BACK_TYPE));

            //if (txtSTEP_TYPE.Items.Count > 1)
            //{
            //    txtSTEP_TYPE.SelectedIndex = 1;
            //}
            if (!string.IsNullOrEmpty(Request["stepType"]))
            {
                txtSTEP_TYPE.Value = Request["stepType"];
                txtSTEP_TYPE.Disabled = true;
            }

            try
            {
                if (keyid != "")
                {
                    valObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, keyid);
                    title += valObj.STEP_NAME + "-" + valObj.STEP_ID;

                    if (valObj == null) return;
                    txtSTEP_ID.Value = Convert.ToString(valObj.STEP_ID);//Convert.ToInt32
                    txtSTEP_NAME.Value = Convert.ToString(valObj.STEP_NAME);//Convert.ToString
                    txtPROCID.Value = Convert.ToString(valObj.PROCID);//Convert.ToInt32
                    txtWFCID.Value = valObj.WFID.ToString();
                    //txtSTEP_NOTE.Value = Convert.ToString(valObj.STEP_NOTE);//Convert.ToString
                    txtSHOW_CONDITION.Value = Convert.ToString(valObj.CONDITION);//Convert.ToString
                    txtSHOW_FORMULA.Value = Convert.ToString(valObj.FORMULAR);//Convert.ToString
                    txtSTEP_TYPE.Value = valObj.STEP_TYPE.ToString();
                    txtNOTE.Value = Convert.ToString(valObj.NOTE);//Convert.ToString
                    txtBACK_TYPE.Value = Convert.ToString(valObj.BACK_TYPE);
                    txtWF_STEP_TPL_LIFE_TIME.Value =  Convert.ToString(valObj.LIFE_TIME);
                    wucSelStaff1.SetSelEmps(valObj.NOTICE_MBR);

                    txtWF_STEP_TPL_ISALLOW_GOTO.Checked = valObj.ISALLOW_GOTO;

                    ViewState["PROCID"] = valObj.PROCID;
                    if (valObj.STEP_TYPE.ToString() == WFEnum.StepType.Activity.ToString("d"))
                    {
                        WF_CHECKER_TPL hhh1 = new WF_CHECKER_TPL();
                        hhh1.STEP_ID = valObj.STEP_ID;
                        hhh1.WFID = valObj.WFID;
                        hhh1.PROCID = valObj.PROCID;
                        bool hadChecker = BLLTable<WF_CHECKER_TPL>.Exists(hhh1);

                        WF_STEP_FORM_TPL hhh2 = new WF_STEP_FORM_TPL();
                        hhh2.STEP_ID = valObj.STEP_ID;
                        hhh2.WFID = valObj.WFID;
                        hhh2.PROCID = valObj.PROCID;
                        bool hadCKForm = BLLTable<WF_STEP_FORM_TPL>.Exists(hhh2);

                        WF_STEPATH_TPL hhh3 = new WF_STEPATH_TPL();
                        hhh3.STEP_ID = valObj.STEP_ID;
                        hhh3.WFID = valObj.WFID;
                        hhh3.PROCID = valObj.PROCID;
                        hhh3.CONDITION = "";
                        //hhh3.Where("(WF_STEPATH_TPL.Condition<>'' and WF_STEPATH_TPL.Condition is not null)");
                        //bool hadCond = BLLTable<WF_STEPATH_TPL>.Exists(hhh3);

                        WF_STEPATH_TPL val30 = new WF_STEPATH_TPL();
                        val30.CONDITION = "";
                        val30.NEXT_ID = 1;
                        WF_STEP_TPL val31 = new WF_STEP_TPL(); val31.STEP_NAME = ""; val31.STEP_ID = 1;

                        List<WF_STEP_TPL> list3 = BLLTable<WF_STEP_TPL>.Select(val31, new Relation(WF_STEPATH_TPL.Attribute.NEXT_ID, WF_STEP_TPL.Attribute.STEP_ID)
                        , val30, hhh3);

                        litMore.Text += "<dl><dt>��̽ڵ㣺</dt><dd>" + (list3.Count > 0 ? list3[0].STEP_NAME : "δ����") + "</dd></dl>";
                        litMore.Text += "<dl><dt>����ˣ�</dt><dd>" + (hadChecker == true ? "������" : "δ����") + "</dd></dl>";
                        litMore.Text += "<dl><dt>����������</dt><dd>" + (hadCKForm == true ? "������" : "δ����") + "</dd></dl>";
                        litMore.Text += "<dl><dt>�������</dt><dd>" + (list3.Count > 0 && list3[0].CONDITION != null ? list3[0].CONDITION : "δ����") + "</dd></dl>";
                    }
                }
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }

            if (Request["setpSetting"] != null)
            {
                btnOK.Enabled = false;
                //btnCloseWin.Disabled = true;
                btnCloseWin.Attributes["onclick"] = "window.parent.close();";
                txtSTEP_TYPE.Disabled = true;
            }
        }
        Page.Title = title;
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["selCOLUMN"] != null)
        {
            WF_STEP_FORM_TPL valObj = new WF_STEP_FORM_TPL();
            int stepid = int.Parse(Request["StepID"]);

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

            valObj.WFID      = stepObj.WFID;
            valObj.PROCID    = stepObj.PROCID;
            valObj.STEP_ID   = stepid;
            valObj.COLUMN_ID = Convert.ToInt32(Request["selCOLUMN"]);

            TF_F_COLUMN wfObj = BLLTable <TF_F_COLUMN> .Factory(conn).GetRowData(TF_F_COLUMN.Attribute.COLUMN_ID, valObj.COLUMN_ID);

            valObj.FORM_ID = wfObj.FORM_ID;

            BLLTable <WF_STEP_FORM_TPL> .Factory(conn).Insert(valObj, WF_STEP_FORM_TPL.Attribute.STEP_FID);

            Response.Write(valObj._COLUMN_ID.ToString());
        }
        //在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelByKeyID"] != null)
        {
            int re = BLLTable <WF_STEP_FORM_TPL> .Factory(conn).Delete(WF_STEP_FORM_TPL.Attribute.STEP_FID, Request["DelByKeyID"]);

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

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

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

        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            WF_STEP_FORM_TPL val = new WF_STEP_FORM_TPL();
            val.STEP_FID = 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_STEP_FORM_TPL> .Factory(conn).Update(val, WF_STEP_FORM_TPL.Attribute.STEP_FID);

            Response.Write("修改用户信息成功");
        }
        Response.End();
    }
Exemple #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid              = int.Parse(Request["PROCID"]);
            condObj.PROCID      = procid;
            condObj_Step.PROCID = procid;
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid              = int.Parse(Request["WFID"]);
            condObj.WFID      = wfid;
            condObj_Step.WFID = wfid;
        }
        if (Request["STEP_ID"] != null)
        {
            stepid = int.Parse(Request["STEP_ID"]);
            //condObj_Step.STEP_ID = stepid;
        }
        if (Request["STEP_TYPE"] != null)
        {
            STEP_TYPE = int.Parse(Request["STEP_TYPE"]);
            //condObj.STEP_TYPE = STEP_TYPE;//查找所有 路由节点,或活动节点
            condObj_Step.NODE_TYPE = STEP_TYPE;
        }
        valObj.OrderBy(WF_STEP_TPL.Attribute.STEP_ID, Order.Asc);
        valObj_Step.OrderBy(WF_STEPATH_TPL.Attribute.STEP_ID, Order.Asc);
        //if (Request["NEXT_ID"] != null)
        //{
        //    NEXT_ID = int.Parse(Request["NEXT_ID"]);
        //    condObj_Step.NEXT_ID = NEXT_ID;
        //}
        if (Request["PATH_TYPE"] != null)
        {
            PATH_TYPE = int.Parse(Request["PATH_TYPE"]);
            condObj_Step.PATH_TYPE = PATH_TYPE;
        }

        //入口选取活动节点
        if (STEP_TYPE == 1)
        {
            condObj.STEP_TYPE = STEP_TYPE;

            //做更新的时候判断用,更新类型 1:真出口 3:假出口 0:入口
            PATH_TYPE = 0;
        }
        else
        {
            //假出口选取路由节点
            if (PATH_TYPE == 3)
            {
                condObj.STEP_TYPE = STEP_TYPE;
            }
        }

        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request["STEP_ID"]) || !string.IsNullOrEmpty(Request["NEXT_ID"]))
            {
                List <WF_STEPATH_TPL> lstPath = new List <WF_STEPATH_TPL>();
                //
                WF_STEP_TPL vvv = new WF_STEP_TPL();
                vvv.STEP_NAME = "";
                vvv.STEP_ID   = 0;
                if (STEP_TYPE == 1)
                {
                    condObj_Step.NEXT_ID = stepid;
                    //找入口节点,按照条件找到 起点
                    lstPath = BLLTable <WF_STEPATH_TPL> .Factory(conn).Select(valObj_Step, new Relation(WF_STEPATH_TPL.Attribute.STEP_ID, WF_STEP_TPL.Attribute.STEP_ID, RelationType.LeftJoin),
                                                                              vvv, condObj_Step);
                }
                else  //找出口节点
                {
                    condObj_Step.STEP_ID = stepid;
                    lstPath = BLLTable <WF_STEPATH_TPL> .Factory(conn).Select(valObj_Step, new Relation(WF_STEPATH_TPL.Attribute.NEXT_ID, WF_STEP_TPL.Attribute.STEP_ID, RelationType.LeftJoin),
                                                                              vvv, condObj_Step);
                }

                BLLTable.SQL_Test.ToString();

                //设置已选中的行
                if (lstPath != null)
                {
                    for (int i = 0; i < lstPath.Count; i++)
                    {
                        if (i > 0)
                        {
                            hidOld.Value     += ",";
                            hidInitIDS.Value += ",";
                        }
                        {
                            hidOld.Value     += "{ID:'" + lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_ID) + "',Name:'" + lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_NAME) + "'}";//这里的Name用于显示在列表中,请自行重定义。
                            hidInitIDS.Value += lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_ID);
                        }
                    }
                }
            }
            try
            {
                listObj = BLLTable <WF_STEP_TPL> .Factory(conn).Select(valObj, condObj);

                repList.DataSource = listObj;
                repList.DataBind();
            }
            catch (Exception ex)
            {
                litWarn.Text = ex.Message;
            }
        }
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        if (Request["STEP_ID"] != null)
        {
            stepid = int.Parse(Request["STEP_ID"]);
        }
        title      = "后继节点";
        Page.Title = title;
        if (!IsPostBack)
        {
            MemCacheSerivce.SetVersion(WF_PROCESS_EXD_TPL.getTableName(procid));

            WFSTEP_EXD_TPL step = WF_PROCESS_EXD_TPL.GetWFSTEP_EXD(procid, stepid);

            //出口
            listObj = step.WF_STEPATH_Out;

            foreach (WF_STEPATH_TPL tp1 in listObj)
            {
                //真出口-通过区
                if (tp1.PATH_TYPE == 1)
                {
                    listObj1.Add(tp1);
                }
                else if (tp1.PATH_TYPE == 2)//跳转区
                {
                    listObj2.Add(tp1);
                }
                else if (tp1.PATH_TYPE == 3)//假出口-退回区
                {
                    listObj3.Add(tp1);
                }
            }

            rep1.DataSource = listObj1;
            rep1.DataBind();
            rep2.DataSource = listObj2;
            rep2.DataBind();
            rep3.DataSource = listObj3;
            rep3.DataBind();

            rep0.DataSource = step.WF_STEPATH_In;
            rep0.DataBind();

            //路由 中 配置条件 //zlg
            step1 = BLLTable <WF_STEP_TPL> .GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);

            {
                txtCONDITION.Value = step1.CONDITION; // 条件:[{0:与},{1:或},{2:通过个数},{3:自定义公式(&&||)}]
                txtFORMULAR.Value  = step1.FORMULAR;  // 公式
            }
        }
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        else
        {
            if (!string.IsNullOrEmpty(Request["PROCID"]))
            {
                procid = int.Parse(Request["PROCID"]);
                WF_PROCESS_TPL proc = BLLTable <WF_PROCESS_TPL> .GetRowData(WF_PROCESS_TPL.Attribute.PROCID, procid);

                wfid   = proc.WFID;
                title += proc.PROC_NAME + "-";
            }
            else
            {
                Response.Write("非法连接!");
                Response.End();
            }
        }
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        else
        {
            List <WF_PROCESS_TPL> lstProc = BLLTable <WF_PROCESS_TPL> .Select(WF_PROCESS_TPL.Attribute.WFID, wfid);

            if (lstProc.Count > 0)
            {
                procid = lstProc[0].PROCID;
                title += lstProc[0].PROC_NAME + "-";
            }
            else
            {
                ScriptHelper.AlertAndGo(Page, "此流程未配置过程!", "../PROCESS/PROCESSManage.aspx?WFID=" + wfid);
            }
        }
        preUrl = WebHelper.GetAppPath();
        theme  = preUrl + "Themes/" + BasePage._ThemeName;

        if (!IsPostBack)
        {
            string      strJs = "";
            WF_STEP_TPL cond  = new WF_STEP_TPL();
            cond.WFID   = wfid;
            cond.PROCID = procid;


            List <WF_STEP_TPL> lstStep = BLLTable <WF_STEP_TPL> .Factory(conn).Select(new WF_STEP_TPL(), cond);

            foreach (WF_STEP_TPL step in lstStep)
            {
                if (step.STEP_TYPE == 0)
                {
                    htmlText += "<div class='node node-start' type =0 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span></div>";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "',hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                }
                else if (step.STEP_TYPE == 3)
                {
                    htmlText += "<div class='node node-end' type =3 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='active-end'><span>" + step.STEP_NAME + "</span></div></div>";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "', solidCircle, { anchors: \"TopCenter\",uuid:\'" + step.STEP_ID + "s\'  });";
                }
                else if (step.STEP_TYPE == 2)
                {
                    // htmlText += "<div class='node node-route' type =2 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='route-content'><span>" + step.STEP_NAME + "</span></div></div>";
                    htmlText += "<div class='node roate' type =2 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span></div>";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "',  solidCircle,{ anchors: \"TopCenter\",uuid:\'" + step.STEP_ID + "s\'  });";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "', hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                }
                else
                {
                    htmlText += "<div class='node node-active' type =1 id='" + step.STEP_ID + "'style='left:" + step.BLOCKX + "px;top:" + step.BLOCKY + "px;' ><span>" + step.STEP_NAME + "</span><div class='active-content'><span>" + step.STEP_NAME + "</span></div></div>";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "',hollowCircle, { anchors: \"BottomCenter\",uuid:\'" + step.STEP_ID + "e\'  });";
                    strJs    += "jsPlumb.addEndpoint('" + step.STEP_ID + "', solidCircle, { anchors: \"TopCenter\" ,uuid:\'" + step.STEP_ID + "s\' });";
                }
                strJs += "jsPlumb.draggable('" + step.STEP_ID + "');";
                strJs += "doubleclick(" + step.STEP_ID + "," + step.STEP_TYPE + ");";
            }

            WF_STEPATH_TPL condP = new WF_STEPATH_TPL();
            condP.WFID   = wfid;
            condP.PROCID = procid;

            List <WF_STEPATH_TPL> lstPath = BLLTable <WF_STEPATH_TPL> .Factory(conn).Select(new WF_STEPATH_TPL(), condP);

            foreach (WF_STEPATH_TPL path in lstPath)
            {
                //strJs += "jsPlumb.bind(\"connection\",function (connInfo, originalEvent) {	connInfo.connection.setLabel(\" \")});";
                strJs += "jsPlumb.connect({ uuids:[ \"" + path.STEP_ID + "e\",  \"" + path.NEXT_ID +
                         "s\"], detachable:true});";
            }
            //{uuids:["Window2BottomCenter", "Window3TopCenter"], editable:true}
            //HtmlGenericControl sss = new HtmlGenericControl();
            //sss.Attributes.Add("src", "/lib/StepCtr/StepCtr.js");
            //sss.Attributes.Add("type", "text/javascript");

            //Page.Header.Controls.AddAt(4, sss);
            // Response.Write("<script src=\"" + ResolveUrl("~/lib/jquery/jquery-1.11.1.min.js") + "\" type=\"text/javascript\"></script>");
            // Response.Write("<script src=\"" + ResolveUrl("~/lib/StepCtr/StepCtr.js") + "\" type=\"text/javascript\"></script>");


            script = "jsPlumb.ready(function () {" + strJs + "});";
            // ClientScript.RegisterStartupScript(this.GetType(), "myscript", script, true);
        }
    }
    /// <summary>
    /// 删除节点
    /// </summary>
    /// <returns></returns>
    private string delStep()
    {
        WF_STEP_TPL valObj = new WF_STEP_TPL();
        try
        {
            int count = WFAdmin.delStep(Common.GetReqIntValue("STEP_ID"));

            if (count > 0)
            {
                return count.ToString();
            }
            else
            {
                return "0";
            }
        }
        catch
        {
            return "-1";
        }
    }
    int delWFINFO(string wfid,out string msg)
    {
        msg = "";
        WF_STEP_TPL ccc1 = new WF_STEP_TPL();
        ccc1.WFID = int.Parse(wfid);
        ccc1.STEP_TYPE = 1;
        if (BLLTable<WF_STEP_TPL>.Exists(ccc1))
        {
            msg = "���ڲ��裬����ɾ����";
            return 0;
        }
        WF_INFO wf = BLLTable<WF_INFO>.Factory(conn).GetRowData(WF_INFO.Attribute.WFID, wfid);

        int re = BLLTable<WF_INFO>.Factory(conn).Delete(WF_INFO.Attribute.WFID, wfid);
        if (re > 0)
        {
            BLLTable<WF_PROCESS>.Factory(conn).Delete(WF_PROCESS.Attribute.WFID, wfid);
            BLLTable<WF_PROCESS_TPL>.Factory(conn).Delete(WF_PROCESS_TPL.Attribute.WFID, wfid);

            BLLTable<WF_STEP>.Factory(conn).Delete(WF_STEP.Attribute.WFID, wfid);
            BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.WFID, wfid);

            BLLTable<WF_CHECKER>.Factory(conn).Delete(WF_CHECKER.Attribute.WFID, wfid);
            BLLTable<WF_CHECKER_TPL>.Factory(conn).Delete(WF_CHECKER_TPL.Attribute.WFID, wfid);

            BLLTable<WF_PROCVAR>.Factory(conn).Delete(WF_PROCVAR.Attribute.WFID, wfid);
            BLLTable<WF_PROCVAR_TPL>.Factory(conn).Delete(WF_PROCVAR_TPL.Attribute.WFID, wfid);

            BLLTable<WF_STEPATH>.Factory(conn).Delete(WF_STEPATH.Attribute.WFID, wfid);
            BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(WF_STEPATH_TPL.Attribute.WFID, wfid);

            //jinshenjian
            BLLTable<WF_WFOBJECT>.Factory(conn).Delete(WF_WFOBJECT.Attribute.WFID_SRC, wfid);
            //jinshenjian

            WFCOMMON_DAL.DelWFTable(wf.WFID);
        }
        return re;
    }
Exemple #17
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);
        //}
    }
Exemple #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write("ddddddd"); Response.End();
        //return;
        if (Request["DelNodeByID"] != null)
        {
            #region//DelNodeByID
            WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
            ccc.STEP_ID = int.Parse(Request["StepID"]);
            WF_STEP_TPL stepObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, ccc.STEP_ID);

            ccc.WFID    = stepObj.WFID;
            ccc.PROCID  = stepObj.PROCID;
            ccc.NEXT_ID = int.Parse(Request["DelNodeByID"]);
            int re = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(ccc);

            Response.Write("1");

            #endregion
        }

        //更新入口,出口,跳转节点,
        if (Request["ToStepIDS"] != null)
        {
            string PATH_TYPE = "";
            //更新类型 1:真出口 2:假出口 其他:入口
            if (Request["PATH_TYPE"] != null)
            {
                PATH_TYPE = Convert.ToString(Request["PATH_TYPE"]);
            }

            string[] stepIds = Request["ToStepIDS"].Split(',');

            //删除原来的路径
            string      nextstepid  = Request["StepID"];
            WF_STEP_TPL nextstepObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, nextstepid);

            WF_STEPATH_TPL objdel = new WF_STEPATH_TPL();
            objdel.WFID   = nextstepObj.WFID;
            objdel.PROCID = nextstepObj.PROCID;

            //真出口
            if (PATH_TYPE.Equals("1"))
            {
                objdel.STEP_ID   = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 1; //普通
                objdel.NODE_TYPE = 2; //路由
            }
            //假出口
            else if (PATH_TYPE.Equals("3"))
            {
                objdel.STEP_ID   = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 3; //返回
                objdel.NODE_TYPE = 2; //路由
            }
            //入口
            else
            {
                objdel.NEXT_ID   = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 1; //普通
                objdel.NODE_TYPE = 1; //活动
            }

            int re = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(objdel);

            if (re >= 0)
            {
                //添加新的路径
                foreach (string str in stepIds)
                {
                    WF_STEPATH_TPL step = new WF_STEPATH_TPL();
                    step.WFID   = nextstepObj.WFID;
                    step.PROCID = nextstepObj.PROCID;

                    //真出口
                    if (PATH_TYPE.Equals("1"))
                    {
                        step.STEP_ID   = Convert.ToInt32(nextstepid);
                        step.NEXT_ID   = Convert.ToInt32(str);
                        step.NODE_TYPE = 2;
                        step.PATH_TYPE = 1;
                    }
                    //假出口
                    else if (PATH_TYPE.Equals("3"))
                    {
                        step.STEP_ID   = Convert.ToInt32(nextstepid);
                        step.NEXT_ID   = Convert.ToInt32(str);
                        step.NODE_TYPE = 2;
                        step.PATH_TYPE = 3;
                    }
                    //入口
                    else
                    {
                        step.STEP_ID   = Convert.ToInt32(str);
                        step.NEXT_ID   = Convert.ToInt32(nextstepid);
                        step.NODE_TYPE = 1;
                        step.PATH_TYPE = 1;
                    }

                    re = BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(step, WF_STEPATH_TPL.Attribute.PATH_ID);
                }
            }
            Response.Write(re.ToString());
        }


        if (Request["SetNextID"] != null)
        {
            #region//SetNextID
            string      toids   = Request["SetNextID"];
            string      curids  = Request["StepIDS"];
            string[]    curArr  = StringHelper.GetStringArray(curids, ',');
            WF_STEP_TPL stepObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, curArr[0]);

            if (Request["ReNextID"] != null)
            {
                WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
                ccc.WFID   = stepObj.WFID;
                ccc.PROCID = stepObj.PROCID;
                ccc.In(WF_STEPATH_TPL.Attribute.STEP_ID, curids);

                int re = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(ccc);
            }
            if (!string.IsNullOrEmpty(toids))
            {
                string[] lst = StringHelper.GetStringArray(toids, ',');
                for (int a = 0; a < curArr.Length; a++)
                {
                    for (int i = 0; i < lst.Length; i++)
                    {
                        WF_STEPATH_TPL pathVal = new WF_STEPATH_TPL();
                        pathVal.WFID      = stepObj.WFID;
                        pathVal.PROCID    = stepObj.PROCID;
                        pathVal.STEP_ID   = int.Parse(curArr[a]);
                        pathVal.NEXT_ID   = int.Parse(lst[i]);
                        pathVal.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));
                        if (!BLLTable <WF_STEPATH_TPL> .Exists(pathVal))
                        {
                            pathVal.CONDITION = "";
                            pathVal.FORMULAR  = "";
                            BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);

                            WF_STEP_TPL uuu = new WF_STEP_TPL();
                            uuu.WFID    = stepObj.WFID;
                            uuu.PROCID  = stepObj.PROCID;
                            uuu.STEP_ID = pathVal.NEXT_ID;
                            WF_STEP_TPL vvv = new WF_STEP_TPL();
                            vvv.IS_USE = 1;
                            BLLTable <WF_STEP_TPL> .Factory(conn).Update(vvv, uuu);
                        }
                    }
                }
            }

            //Response.Write(re.ToString());


            #endregion

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

        if (Request["DelStepPath"] != null)
        {
            #region//DelStepPath
            string      stepid  = Request["DelStepPath"];
            WF_STEP_TPL stepObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);

            WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
            ccc.WFID   = stepObj.WFID;
            ccc.PROCID = stepObj.PROCID;
            //ccc.NEXT_ID = int.Parse(stepid);
            ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");

            int re = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(ccc);

            WF_STEP_TPL uuu = new WF_STEP_TPL();
            uuu.WFID    = stepObj.WFID;
            uuu.PROCID  = stepObj.PROCID;
            uuu.STEP_ID = int.Parse(stepid);;
            //ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");
            WF_STEP_TPL vvv = new WF_STEP_TPL();
            vvv.IS_USE = 0;
            BLLTable <WF_STEP_TPL> .Factory(conn).Update(vvv, uuu);

            Response.Write(re.ToString());

            #endregion
        }
        #region//在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelByKeyID"] != null)
        {
            int re = delStep(Request["DelByKeyID"]);// BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, Request["DelSTEP_ID"]);
            if (re > 0)
            {
                Response.Write("{re:1,msg:''}");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("{re:0,msg:''}");
            }
        }
        #endregion

        #region//在列表里点击删除按钮,通过AJAX执行这里的后台代码,删除一条记录
        if (Request["DelSTEP_ID"] != null)
        {
            int re = delStep(Request["DelSTEP_ID"]);// BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, Request["DelSTEP_ID"]);
            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }
        #endregion

        #region//在列表顶部点击删除按钮,通过AJAX执行这里的后台代码,删除多条记录
        if (Request["DelKeyIDS"] != null)
        {
            string[] arr = StringHelper.GetStringArray(Request["DelKeyIDS"], ',');
            int      re  = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                re += delStep(arr[i]);
            }
            //WF_STEP_TPL cond = new WF_STEP_TPL();
            //cond.In(WF_STEP_TPL.Attribute.STEP_ID, Request["DelKeyIDS"]);
            //int re = BLLTable<WF_STEP_TPL>.Factory(conn).Delete(cond);
            if (re > 0)
            {
                Response.Write("1");//可以输出数字 大于0 表示操作成功,也可以直接输出 字符串,客户端将弹出此字符串信息作为提示
            }
            else
            {
                Response.Write("删除失败!");
            }
        }
        #endregion

        #region//验证过程是否配置正确
        if (Request["checkProc"] != null)
        {
            int wfid   = int.Parse(Request["WFID"]);
            int procid = int.Parse(Request["PROCID"]);
            if (WFAdmin.IsProcessSetComp(wfid, procid, false))
            {
                Response.Write("过程配置正确!");
            }
            else
            {
                Response.Write("过程配置错误!");
            }
            string msg = null;
            if (!WFAdmin.IsProcessDBSetOK(wfid, procid, out msg))
            {
                Response.Write(msg);
            }
        }

        #endregion

        #region//复制流程
        if (Request["cloneProc"] != null)
        {
            int    wfid   = int.Parse(Request["WFID"]);
            int    procid = int.Parse(Request["PROCID"]);
            string outMsg = "";
            bool   isOk   = false;
            isOk = WFAdmin.IsProcessDBSetOK(wfid, procid, out outMsg);
            if (isOk == true)
            {
                isOk = WFAdmin.IsProcessSetComp(wfid, procid, false);
                if (isOk == false)
                {
                    outMsg = "过程配置不正确!";
                }
            }

            if (isOk == true)
            {
                int re = WFAdmin.CloneProcess(procid);
                if (re > 0)
                {
                    BLLTable <WF_INFO> .Factory(conn).Update(WF_INFO.Attribute.WFID, wfid, WF_INFO.Attribute.STATUS, 1);

                    Response.Write("ok");
                }
                else
                {
                    Response.Write("执行启动过程失败!");
                }
            }
            else
            {
                Response.Write(outMsg);
            }
        }
        #endregion

        #region//启用流程
        if (Request["applyProc"] != null)
        {
            int    wfid   = int.Parse(Request["WFID"]);
            int    procid = int.Parse(Request["PROCID"]);
            string outMsg = "";
            bool   isOk   = false;
            isOk = WFAdmin.IsProcessDBSetOK(wfid, procid, out outMsg);
            if (isOk == true)
            {
                isOk = WFAdmin.IsProcessSetComp(wfid, procid, false);
                if (isOk == false)
                {
                    outMsg = "过程配置不正确!";
                }
            }

            if (isOk == true)
            {
                int re = WFAdmin.ApplyProcess(procid);
                if (re > 0)
                {
                    BLLTable <WF_INFO> .Factory(conn).Update(WF_INFO.Attribute.WFID, wfid, WF_INFO.Attribute.STATUS, 1);

                    Response.Write("ok");
                }
                else
                {
                    Response.Write("应用过程失败!");
                }
            }
            else
            {
                Response.Write(outMsg);
            }
        }
        #endregion

        #region//保存数据
        //在用户详细信息查看编辑页面,点保存时,通过AJAX执行这里的后台代码,实现部门字段的更新
        if (Request["saveInfo"] != null)
        {
            WF_STEP_TPL val = new WF_STEP_TPL();
            val.STEP_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_STEP_TPL> .Factory(conn).Update(val, WF_STEP_TPL.Attribute.STEP_ID);

            Response.Write("修改用户信息成功");
        }
        #endregion

        #region////显示子节点
        if (Request["getSubNodes"] != null)
        {
            string        nodetype = Request["ntype"];
            StringBuilder sb       = new StringBuilder("[");
            string        id       = Request["id"];
            if (nodetype == "root")
            {
                #region
                WF_PROCESS_TPL obj = new WF_PROCESS_TPL();
                obj.WFID = int.Parse(id);
                WF_PROCESS_TPL val = new WF_PROCESS_TPL();
                val.OrderBy(WF_PROCESS_TPL.Attribute.PROCID, Order.Asc);
                List <WF_PROCESS_TPL> lst = BLLTable <WF_PROCESS_TPL> .Factory(conn).Select(val, obj);

                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        sb.Append("{id:'").Append(lst[i].PROCID);
                        sb.Append("',pid:'").Append("0").Append("',no:").Append(lst[i].PROCID);
                        sb.Append(",sc:").Append("0");
                        sb.Append(",name:'").Append(lst[i].PROC_NAME).Append("',ntype:'proc'}");
                    }
                }
                #endregion
            }
            if (nodetype == "proc")
            {
                #region
                WF_STEP_TPL obj = new WF_STEP_TPL();
                obj.PROCID = int.Parse(id);
                obj.Where("STEP_TYPE in(1,2)");
                WF_STEP_TPL val = new WF_STEP_TPL();
                val.OrderBy(WF_STEP_TPL.Attribute.SORT_NUM, Order.Asc);
                List <WF_STEP_TPL> lst = BLLTable <WF_STEP_TPL> .Factory(conn).Select(val, obj);

                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        string type = "step";
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.Begin.ToString("d"))
                        {
                            type = "begin";
                        }
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.End.ToString("d"))
                        {
                            type = "end";
                        }
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.Roate.ToString("d"))
                        {
                            type = "roate";
                        }
                        sb.Append("{id:'").Append(lst[i].STEP_ID);
                        sb.Append("',pid:'").Append("0").Append("',no:").Append(lst[i].SORT_NUM);
                        sb.Append(",sc:").Append("0");
                        sb.Append(",name:'").Append(lst[i].STEP_NAME).Append("',ntype:'" + type + "'}");
                    }
                }
                #endregion
            }
            sb.Append("]");
            Response.Write(sb.ToString());
        }
        #endregion

        if (Request["deleteNode"] != null)
        {
            #region//deleteNode
            int    re     = 0;
            string stepid = Request["id"];

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

                WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
                ccc.WFID   = stepObj.WFID;
                ccc.PROCID = stepObj.PROCID;
                ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");

                BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(ccc);


                BLLTable <WF_CHECKER_TPL> .Factory(conn).Delete(WF_CHECKER_TPL.Attribute.STEP_ID, stepid);

                BLLTable <WF_STEP_FORM_TPL> .Factory(conn).Delete(WF_STEP_FORM_TPL.Attribute.STEP_ID, stepid);

                BLLTable <WF_STEPVAR_TPL> .Factory(conn).Delete(WF_STEPVAR_TPL.Attribute.STEP_ID, stepid);

                re = BLLTable <WF_STEP_TPL> .Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, stepid);
            }
            catch
            {
                re = -1;
            }
            if (re > 0)
            {
                Response.Write("{re:1,msg:'删除节点成功!'}");
            }
            else
            {
                Response.Write("{re:0,msg:'删除节点失败!'}");
            }

            #endregion
        }
        Response.End();
    }
Exemple #19
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            WF_STEP_TPL valObj = new WF_STEP_TPL();

            if (txtWFCID.Value != "")
                valObj.WFID = Convert.ToInt32(txtWFCID.Value);
            if (txtSTEP_ID.Value != "")
                valObj.STEP_ID = Convert.ToInt32(txtSTEP_ID.Value);
            if (txtSTEP_NAME.Value != "")
                valObj.STEP_NAME = Convert.ToString(txtSTEP_NAME.Value);
            if (txtPROCID.Value != "")
                valObj.PROCID = Convert.ToInt32(txtPROCID.Value);

            valObj.ISALLOW_GOTO = txtWF_STEP_TPL_ISALLOW_GOTO.Checked;

            if (txtWF_STEP_TPL_LIFE_TIME.Value != "")
                valObj.LIFE_TIME =  Convert.ToInt32(txtWF_STEP_TPL_LIFE_TIME.Value);

            //��ȡ֪ͨ��
            valObj.NOTICE_MBR = wucSelStaff1.GetSelEmpIDS();

            if (txtSTEP_TYPE.Value != "")
                valObj.STEP_TYPE = Convert.ToInt32(txtSTEP_TYPE.Value);
            if (txtNOTE.Value != "")
                valObj.NOTE = Convert.ToString(txtNOTE.Value);

            if (txtBACK_TYPE.Value != "")
                valObj.BACK_TYPE = Convert.ToInt32(txtBACK_TYPE.Value);
            //List<WF_STEPATH_TPL> lstPath = null;

            if (keyid != "")
            {
                valObj.STEP_ID = Convert.ToInt32(keyid);
                count = BLLTable<WF_STEP_TPL>.Factory(conn).Update(valObj, WF_STEP_TPL.Attribute.STEP_ID);
            }
            else
            {
                valObj.CONDITION = txtSHOW_CONDITION.Value;
                valObj.FORMULAR = txtSHOW_FORMULA.Value;

                //WF_STEPATH_TPL pathCond=new WF_STEPATH_TPL();
                //pathCond.NEXT_ID=0;
                //pathCond.WFID = wfid;
                //pathCond.PROCID = procid;
                //lstPath = BLLTable<WF_STEPATH_TPL>.Factory(conn).Select(new WF_STEPATH_TPL(), pathCond);

                count = BLLTable<WF_STEP_TPL>.Factory(conn).Insert(valObj, WF_STEP_TPL.Attribute.STEP_ID);
                keyid = valObj.STEP_ID.ToString();

                if (count > 0)
                {
                    #region//���ݽ��������˳����Ĭ�Ϲ���·��

                    //WF_STEPATH_TPL path1 = new WF_STEPATH_TPL();
                    //path1.WFID = wfid;
                    //path1.PROCID = procid;
                    //path1.NODE_TYPE = 0;
                    //path1.STEP_ID = int.Parse(keyid);
                    //BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(path1, WF_STEPATH_TPL.Attribute.PATH_ID);

                    //WF_RULE_TPL preUp = new WF_RULE_TPL();
                    //preUp.STEPS_OUT = keyid;
                    //preUp.NEXT_RULE_ID = rule_e.RULE_ID;
                    //preUp.RULE_ID = rule_pre.RULE_ID;
                    //if (preIsEnd) {
                    //    preUp.RULE_TYPE = 1;
                    //}
                    //BLLTable<WF_RULE_TPL>.Factory(conn).Update(preUp, WF_RULE_TPL.Attribute.RULE_ID);

                    //path1.STEP_TYPE = "1";
                    //path1.RULE_ID = preUp.RULE_ID;
                    //path1.STEP_ID = int.Parse(keyid);
                    //BLLTable<WF_RULEPATH_TPL>.Factory(conn).Insert(path1, WF_RULEPATH_TPL.Attribute.R_PATH_ID);

                    ////���ݽ���������Ⱥ�˳��  ����Ĭ�ϵIJ���·��
                    //if (lstPath != null && lstPath.Count > 0)
                    //{
                    //    for (int i = 0; i < lstPath.Count; i++)
                    //    {
                    //        WF_STEPATH_TPL cond1 = new WF_STEPATH_TPL();
                    //        cond1.WFID = wfid;
                    //        cond1.PROCID = procid;
                    //        cond1.STEP_ID = lstPath[i].STEP_ID;
                    //        WF_STEPATH_TPL val1 = new WF_STEPATH_TPL();
                    //        val1.NEXT_ID = int.Parse(keyid);

                    //        BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(val1, cond1);

                    //        WF_STEPATH_TPL cond2 = new WF_STEPATH_TPL();
                    //        cond2.WFID = wfid;
                    //        cond2.PROCID = procid;
                    //        cond2.STEP_ID = int.Parse(keyid);
                    //        WF_STEPATH_TPL val2 = new WF_STEPATH_TPL();
                    //        val2.PREV_ID = lstPath[i].STEP_ID;
                    //        BLLTable<WF_STEPATH_TPL>.Factory(conn).Update(val2, cond2);

                    //        WF_STEPATH_TPL preVal = new WF_STEPATH_TPL();

                    //        preVal.PREV_ID = lstPath[i].STEP_ID;
                    //        preVal.STEP_ID = valObj.STEP_ID;
                    //        preVal.NEXT_ID = 0;
                    //        preVal.WFID = valObj.WFID;
                    //        preVal.PROCID = valObj.PROCID;
                    //        if (!BLLTable<WF_STEPATH_TPL>.Exists(preVal))
                    //        {
                    //            preVal.CONDITION = "";
                    //            preVal.FORMULAR = "";
                    //            BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(preVal);
                    //        }

                    //        WF_STEP_TPL condUp = new WF_STEP_TPL();
                    //        condUp.WFID = wfid;
                    //        condUp.PROCID = procid;
                    //        condUp.STEP_ID = lstPath[i].STEP_ID;
                    //        WF_STEP_TPL upVal = new WF_STEP_TPL();
                    //        upVal.NEXT_IDS = valObj.STEP_ID.ToString();
                    //        BLLTable<WF_STEP_TPL>.Factory(conn).Update(upVal, condUp);

                    //    }
                    //}
                    //else
                    //{
                    //    WF_STEPATH_TPL preVal = new WF_STEPATH_TPL();
                    //    preVal.PREV_ID = 0;
                    //    preVal.STEP_ID = valObj.STEP_ID;
                    //    preVal.NEXT_ID = 0;
                    //    preVal.WFID = valObj.WFID;
                    //    preVal.PROCID = valObj.PROCID;
                    //    if (!BLLTable<WF_STEPATH_TPL>.Exists(preVal))
                    //    {
                    //        preVal.CONDITION = "";
                    //        preVal.FORMULAR = "";
                    //        BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(preVal);
                    //    }
                    //}
                    #endregion
                }
            }
            if (count > 0)
            {
                if (Request["tree"] != null)
                {
                    string gotoUrl = "../../../ok.aspx";
                    StringBuilder sb = new StringBuilder("{");
                    sb.Append("id:'");
                    sb.Append(keyid).Append("',pid:'").Append("0").Append("',no:").Append(valObj.SORT_NUM).Append(",sc:0,name:'");

                    string type = "step";
                    if (valObj.STEP_TYPE.ToString() == WFEnum.StepType.Begin.ToString("d"))
                    {
                        type = "begin";
                    }
                    if (valObj.STEP_TYPE.ToString() == WFEnum.StepType.End.ToString("d"))
                    {
                        type = "end";
                    }
                    if (valObj.STEP_TYPE.ToString() == WFEnum.StepType.Roate.ToString("d"))
                    {
                        type = "roate";
                    }
                    sb.Append(valObj.STEP_NAME).Append("',ntype:'" + type + "'}");

                    if (Request["edit"] == null)
                    {
                        AgileFrame.Core.ScriptHelper.ResponseScript(Page, "parent.TV.showSubNodes(\"" + sb.ToString() + "\");location.replace('" + gotoUrl + "');", false);
                    }
                    else
                    {
                        AgileFrame.Core.ScriptHelper.ResponseScript(Page, "parent.TV.editNodeInfo(\"" + sb.ToString() + "\");location.replace('" + gotoUrl + "');", false);
                    }
                }
                else
                {
                    StringBuilder sbData = new StringBuilder();
                    if (ViewState["sbData"] != null)
                    {
                        sbData.Append(ViewState["sbData"].ToString()).Append(",");
                    }
                    sbData.Append("{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("'");
                            if (lstCol[i] == WF_STEP_TPL.Attribute.STEP_TYPE)
                            {
                                sbData.Append(",").Append("STEP_TYPE_NAME").Append(":'").Append(FormHelper.GetText(WF_STEP_TPL.Attribute.STEP_TYPE, val)).Append("'");
                                if (val.ToString() == "2")
                                {
                                    sbData.Append(",").Append("HIDE").Append(":'hide'");
                                }
                            }

                        }
                    }
                    sbData.Append("}");

                    Button btn = (Button)sender;
                    if (btn.ID.IndexOf("btnOK") != -1)
                    {
                        if (Request["preUrl"] != null)
                        {
                            Response.Redirect(Request["preUrl"]);
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(Page, this.GetType(), "goto", "if (window.opener){window.opener.returnValue = \"[" + sbData + "]\";}else{window.returnValue = \"[" + sbData + "]\";}window.close();", true);
                        }
                    }
                    else
                    {
                        litWarn.Text = litWarn.Text == "" ? "��ӽڵ�ɹ���" : litWarn.Text += "�ɹ���";
                        ViewState["sbData"] = sbData.ToString();
                        txtSTEP_ID.Value = "";
                        txtSHOW_CONDITION.Value = "";
                        txtSHOW_FORMULA.Value = "";
                    }
                }
            }
        }
        catch (Exception ex)
        {
            litWarn.Text = ex.Message;
        }
    }
Exemple #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write("ddddddd"); Response.End();
        //return;
        if (Request["DelNodeByID"] != null)
        {
            #region//DelNodeByID
            WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
            ccc.STEP_ID = int.Parse(Request["StepID"]);
            WF_STEP_TPL stepObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, ccc.STEP_ID);
            ccc.WFID = stepObj.WFID;
            ccc.PROCID = stepObj.PROCID;
            ccc.NEXT_ID = int.Parse(Request["DelNodeByID"]);
            int re = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(ccc);
            Response.Write("1");

            #endregion
        }

        //������ڣ����ڣ���ת�ڵ㣬
        if (Request["ToStepIDS"] != null)
        {
            string PATH_TYPE = "";
            //�������� 1������� 2���ٳ��� ���������
            if (Request["PATH_TYPE"] != null)
            {
                PATH_TYPE = Convert.ToString(Request["PATH_TYPE"]);
            }

            string[] stepIds = Request["ToStepIDS"].Split(',');

            //ɾ��ԭ����·��
            string nextstepid = Request["StepID"];
            WF_STEP_TPL nextstepObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, nextstepid);
            WF_STEPATH_TPL objdel = new WF_STEPATH_TPL();
            objdel.WFID = nextstepObj.WFID;
            objdel.PROCID = nextstepObj.PROCID;

            //�����
            if (PATH_TYPE.Equals("1"))
            {
                objdel.STEP_ID = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 1;//��ͨ
                objdel.NODE_TYPE = 2;  //·��
            }
            //�ٳ���
            else if (PATH_TYPE.Equals("3"))
            {
                objdel.STEP_ID = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 3;//����
                objdel.NODE_TYPE = 2;  //·��
            }
            //���
            else
            {
                objdel.NEXT_ID = Convert.ToInt32(nextstepid);
                objdel.PATH_TYPE = 1;//��ͨ
                objdel.NODE_TYPE = 1;  //�
            }

            int re = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(objdel);

            if (re >= 0)
            {
                //����µ�·��
                foreach (string str in stepIds)
                {
                    WF_STEPATH_TPL step = new WF_STEPATH_TPL();
                    step.WFID = nextstepObj.WFID;
                    step.PROCID = nextstepObj.PROCID;

                    //�����
                    if (PATH_TYPE.Equals("1"))
                    {
                        step.STEP_ID = Convert.ToInt32(nextstepid);
                        step.NEXT_ID = Convert.ToInt32(str);
                        step.NODE_TYPE = 2;
                        step.PATH_TYPE = 1;
                    }
                    //�ٳ���
                    else if (PATH_TYPE.Equals("3"))
                    {
                        step.STEP_ID = Convert.ToInt32(nextstepid);
                        step.NEXT_ID = Convert.ToInt32(str);
                        step.NODE_TYPE = 2;
                        step.PATH_TYPE = 3;
                    }
                    //���
                    else
                    {
                        step.STEP_ID = Convert.ToInt32(str);
                        step.NEXT_ID = Convert.ToInt32(nextstepid);
                        step.NODE_TYPE = 1;
                        step.PATH_TYPE = 1;
                    }

                    re = BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(step, WF_STEPATH_TPL.Attribute.PATH_ID);
                }
            }
            Response.Write(re.ToString());
        }

        if (Request["SetNextID"] != null)
        {
            #region//SetNextID
            string toids = Request["SetNextID"];
            string curids = Request["StepIDS"];
            string[] curArr = StringHelper.GetStringArray(curids, ',');
            WF_STEP_TPL stepObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, curArr[0]);

            if (Request["ReNextID"] != null)
            {
                WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
                ccc.WFID = stepObj.WFID;
                ccc.PROCID = stepObj.PROCID;
                ccc.In(WF_STEPATH_TPL.Attribute.STEP_ID, curids);

                int re = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(ccc);

            }
            if (!string.IsNullOrEmpty(toids))
            {
                string[] lst = StringHelper.GetStringArray(toids, ',');
                for (int a = 0; a < curArr.Length; a++)
                {
                    for (int i = 0; i < lst.Length; i++)
                    {

                        WF_STEPATH_TPL pathVal = new WF_STEPATH_TPL();
                        pathVal.WFID = stepObj.WFID;
                        pathVal.PROCID = stepObj.PROCID;
                        pathVal.STEP_ID = int.Parse(curArr[a]);
                        pathVal.NEXT_ID = int.Parse(lst[i]);
                        pathVal.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));
                        if (!BLLTable<WF_STEPATH_TPL>.Exists(pathVal))
                        {
                            pathVal.CONDITION = "";
                            pathVal.FORMULAR = "";
                            BLLTable<WF_STEPATH_TPL>.Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);

                            WF_STEP_TPL uuu = new WF_STEP_TPL();
                            uuu.WFID = stepObj.WFID;
                            uuu.PROCID = stepObj.PROCID;
                            uuu.STEP_ID = pathVal.NEXT_ID;
                            WF_STEP_TPL vvv = new WF_STEP_TPL();
                            vvv.IS_USE = 1;
                            BLLTable<WF_STEP_TPL>.Factory(conn).Update(vvv, uuu);

                        }

                    }
                }
            }

            //Response.Write(re.ToString());

            #endregion

            Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ

        }

        if (Request["DelStepPath"] != null)
        {
            #region//DelStepPath
            string stepid = Request["DelStepPath"];
            WF_STEP_TPL stepObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);
            WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
            ccc.WFID = stepObj.WFID;
            ccc.PROCID = stepObj.PROCID;
            //ccc.NEXT_ID = int.Parse(stepid);
            ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");

            int re = BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(ccc);

            WF_STEP_TPL uuu = new WF_STEP_TPL();
            uuu.WFID = stepObj.WFID;
            uuu.PROCID = stepObj.PROCID;
            uuu.STEP_ID = int.Parse(stepid); ;
            //ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");
            WF_STEP_TPL vvv = new WF_STEP_TPL();
            vvv.IS_USE = 0;
            BLLTable<WF_STEP_TPL>.Factory(conn).Update(vvv, uuu);

            Response.Write(re.ToString());

            #endregion
        }
        #region//���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelByKeyID"] != null)
        {
            int re = delStep(Request["DelByKeyID"]);// BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, Request["DelSTEP_ID"]);
            if (re > 0)
            {
                Response.Write("{re:1,msg:''}");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("{re:0,msg:''}");
            }
        }
        #endregion

        #region//���б�����ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��һ����¼
        if (Request["DelSTEP_ID"] != null)
        {
            int re = delStep(Request["DelSTEP_ID"]);// BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, Request["DelSTEP_ID"]);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }
        #endregion

        #region//���б�������ɾ����ť��ͨ��AJAXִ������ĺ�̨���룬ɾ��������¼
        if (Request["DelKeyIDS"] != null)
        {
            string[] arr = StringHelper.GetStringArray(Request["DelKeyIDS"], ',');
            int re = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                re += delStep(arr[i]);
            }
            //WF_STEP_TPL cond = new WF_STEP_TPL();
            //cond.In(WF_STEP_TPL.Attribute.STEP_ID, Request["DelKeyIDS"]);
            //int re = BLLTable<WF_STEP_TPL>.Factory(conn).Delete(cond);
            if (re > 0)
            {
                Response.Write("1");//����������� ����0 ��ʾ�����ɹ���Ҳ����ֱ����� �ַ������ͻ��˽��������ַ�����Ϣ��Ϊ��ʾ
            }
            else
            {
                Response.Write("ɾ��ʧ�ܣ�");
            }
        }
        #endregion

        #region//��֤�����Ƿ�������ȷ
        if (Request["checkProc"] != null)
        {
            int wfid = int.Parse(Request["WFID"]);
            int procid = int.Parse(Request["PROCID"]);
            if (WFAdmin.IsProcessSetComp(wfid, procid, false))
            {
                Response.Write("����������ȷ��");
            }
            else
            {
                Response.Write("��������");
            }
            string msg = null;
            if (!WFAdmin.IsProcessDBSetOK(wfid, procid, out msg))
            {
                Response.Write(msg);
            }
        }

        #endregion

        #region//��������
        if (Request["cloneProc"] != null)
        {
            int wfid = int.Parse(Request["WFID"]);
            int procid = int.Parse(Request["PROCID"]);
            string outMsg = "";
            bool isOk = false;
            isOk = WFAdmin.IsProcessDBSetOK(wfid, procid, out outMsg);
            if (isOk == true)
            {
                isOk = WFAdmin.IsProcessSetComp(wfid, procid, false);
                if (isOk == false)
                {
                    outMsg = "�������ò���ȷ��";
                }
            }

            if (isOk == true)
            {

                int re = WFAdmin.CloneProcess(procid);
                if (re > 0)
                {
                    BLLTable<WF_INFO>.Factory(conn).Update(WF_INFO.Attribute.WFID, wfid, WF_INFO.Attribute.STATUS, 1);
                    Response.Write("ok");
                }
                else
                {
                    Response.Write("ִ���������ʧ�ܣ�");
                }
            }
            else
            {
                Response.Write(outMsg);
            }
        }
        #endregion

        #region//��������
        if (Request["applyProc"] != null)
        {
            int wfid = int.Parse(Request["WFID"]);
            int procid = int.Parse(Request["PROCID"]);
            string outMsg = "";
            bool isOk = false;
            isOk = WFAdmin.IsProcessDBSetOK(wfid, procid, out outMsg);
            if (isOk == true)
            {
                isOk = WFAdmin.IsProcessSetComp(wfid, procid, false);
                if (isOk == false)
                {
                    outMsg = "�������ò���ȷ��";
                }
            }

            if (isOk == true)
            {
                int re = WFAdmin.ApplyProcess(procid);
                if (re > 0)
                {

                    BLLTable<WF_INFO>.Factory(conn).Update(WF_INFO.Attribute.WFID, wfid, WF_INFO.Attribute.STATUS, 1);
                    Response.Write("ok");
                }
                else
                {
                    Response.Write("Ӧ�ù���ʧ�ܣ�");
                }
            }
            else
            {
                Response.Write(outMsg);
            }
        }
        #endregion

        #region//��������
        //���û���ϸ��Ϣ�鿴�༭ҳ�棬�㱣��ʱ��ͨ��AJAXִ������ĺ�̨���룬ʵ�ֲ����ֶεĸ���
        if (Request["saveInfo"] != null)
        {
            WF_STEP_TPL val = new WF_STEP_TPL();
            val.STEP_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_STEP_TPL>.Factory(conn).Update(val, WF_STEP_TPL.Attribute.STEP_ID);
            Response.Write("�޸��û���Ϣ�ɹ�");

        }
        #endregion

        #region////��ʾ�ӽڵ�
        if (Request["getSubNodes"] != null)
        {
            string nodetype = Request["ntype"];
            StringBuilder sb = new StringBuilder("[");
            string id = Request["id"];
            if (nodetype == "root")
            {
                #region
                WF_PROCESS_TPL obj = new WF_PROCESS_TPL();
                obj.WFID = int.Parse(id);
                WF_PROCESS_TPL val = new WF_PROCESS_TPL();
                val.OrderBy(WF_PROCESS_TPL.Attribute.PROCID, Order.Asc);
                List<WF_PROCESS_TPL> lst = BLLTable<WF_PROCESS_TPL>.Factory(conn).Select(val, obj);
                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        sb.Append("{id:'").Append(lst[i].PROCID);
                        sb.Append("',pid:'").Append("0").Append("',no:").Append(lst[i].PROCID);
                        sb.Append(",sc:").Append("0");
                        sb.Append(",name:'").Append(lst[i].PROC_NAME).Append("',ntype:'proc'}");
                    }
                }
                #endregion
            }
            if (nodetype == "proc")
            {
                #region
                WF_STEP_TPL obj = new WF_STEP_TPL();
                obj.PROCID = int.Parse(id);
                obj.Where("STEP_TYPE in(1,2)");
                WF_STEP_TPL val = new WF_STEP_TPL();
                val.OrderBy(WF_STEP_TPL.Attribute.SORT_NUM, Order.Asc);
                List<WF_STEP_TPL> lst = BLLTable<WF_STEP_TPL>.Factory(conn).Select(val, obj);
                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        string type = "step";
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.Begin.ToString("d")) {
                            type = "begin";
                        }
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.End.ToString("d"))
                        {
                            type = "end";
                        }
                        if (lst[i].STEP_TYPE.ToString() == WFEnum.StepType.Roate.ToString("d"))
                        {
                            type = "roate";
                        }
                        sb.Append("{id:'").Append(lst[i].STEP_ID);
                        sb.Append("',pid:'").Append("0").Append("',no:").Append(lst[i].SORT_NUM);
                        sb.Append(",sc:").Append("0");
                        sb.Append(",name:'").Append(lst[i].STEP_NAME).Append("',ntype:'" + type + "'}");
                    }
                }
                #endregion
            }
            sb.Append("]");
            Response.Write(sb.ToString());
        }
        #endregion

        if (Request["deleteNode"] != null)
        {
            #region//deleteNode
            int re = 0;
            string stepid = Request["id"];

            try
            {

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

                WF_STEPATH_TPL ccc = new WF_STEPATH_TPL();
                ccc.WFID = stepObj.WFID;
                ccc.PROCID = stepObj.PROCID;
                ccc.Where("(NEXT_ID=" + stepid + " or STEP_ID=" + stepid + ")");

                BLLTable<WF_STEPATH_TPL>.Factory(conn).Delete(ccc);

                BLLTable<WF_CHECKER_TPL>.Factory(conn).Delete(WF_CHECKER_TPL.Attribute.STEP_ID, stepid);
                BLLTable<WF_STEP_FORM_TPL>.Factory(conn).Delete(WF_STEP_FORM_TPL.Attribute.STEP_ID, stepid);
                BLLTable<WF_STEPVAR_TPL>.Factory(conn).Delete(WF_STEPVAR_TPL.Attribute.STEP_ID, stepid);

                re = BLLTable<WF_STEP_TPL>.Factory(conn).Delete(WF_STEP_TPL.Attribute.STEP_ID, stepid);
            }
            catch
            {
                re = -1;
            }
            if (re > 0)
            {
                Response.Write("{re:1,msg:'ɾ���ڵ�ɹ���'}");
            }
            else {
                Response.Write("{re:0,msg:'ɾ���ڵ�ʧ�ܣ�'}");
            }

            #endregion
        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "����  ";

        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        else
        {
            if (!string.IsNullOrEmpty(Request["PROCID"]))
            {
                procid = int.Parse(Request["PROCID"]);
                WF_PROCESS_TPL proc = BLLTable<WF_PROCESS_TPL>.Factory(conn).GetRowData(WF_PROCESS_TPL.Attribute.PROCID, procid);
                wfid = proc.WFID;
                title += proc.PROC_NAME + "-";
            }
            else
            {
                Response.Write("�Ƿ����ӣ�");
                Response.End();
            }
        }
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        else
        {

            List<WF_PROCESS_TPL> lstProc = BLLTable<WF_PROCESS_TPL>.Factory(conn).Select(WF_PROCESS_TPL.Attribute.WFID, wfid);
            if (lstProc.Count > 0)
            {
                procid = lstProc[0].PROCID;
                title += lstProc[0].PROC_NAME + "-";
            }
            else
            {
                ScriptHelper.AlertAndGo(Page, "������δ���ù��̣�", "../PROCESS/PROCESSManage.aspx?WFID=" + wfid);
            }
        }
        if (!IsPostBack)
        {
            #region//���ݳ�ʼ��

            WF_STEP_TPL rule_b = new WF_STEP_TPL();
            rule_b.WFID = wfid;
            rule_b.PROCID = procid;
            rule_b.STEP_TYPE = 0;

            WF_STEP_TPL bObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(new WF_STEP_TPL(), rule_b);
            if (bObj==null)
            {

                rule_b.CONDITION = "";
                rule_b.FORMULAR = "";
                rule_b.STEP_NAME = "��ʼ";
                BLLTable<WF_STEP_TPL>.Factory(conn).Insert(rule_b, WF_STEP_TPL.Attribute.STEP_ID);
                bObj = rule_b;
            }
            litB.Text = bObj.STEP_NAME;
            beginID = bObj.STEP_ID;

            WF_STEP_TPL rule_e = new WF_STEP_TPL();
            rule_e.WFID = wfid;
            rule_e.PROCID = procid;
            rule_e.STEP_TYPE = 3;

            WF_STEP_TPL eObj = BLLTable<WF_STEP_TPL>.Factory(conn).GetRowData(new WF_STEP_TPL(), rule_e);
            if (eObj==null)
            {

                rule_e.CONDITION = "";
                rule_e.FORMULAR = "";
                rule_e.STEP_NAME = "����";
                BLLTable<WF_STEP_TPL>.Factory(conn).Insert(rule_e, WF_STEP_TPL.Attribute.STEP_ID);
                eObj = rule_e;
            }
            litE.Text = eObj.STEP_NAME;
            endID = eObj.STEP_ID;

            WF_INFO wf = BLLTable<WF_INFO>.Factory(conn).GetRowData(WF_INFO.Attribute.WFID, wfid);
            if (wf.STATUS != "1")
            {
                btnApplyTo.Enabled = false;
                btnApplyProc.Disabled = true;
            }
            #endregion

            Dictionary<int, WF_STEP_TPL> noUseSTep = new Dictionary<int, WF_STEP_TPL>();
            //����ͼ���������
            litStepMap.Text = WFAdmin.ShowStepPathMap(wfid, procid, out noUseSTep);

            if (noUseSTep.Count > 0)
            {
                StringBuilder sbMap = new StringBuilder();
                foreach (KeyValuePair<int, WF_STEP_TPL> val in noUseSTep) {

                    string data = "{id:'" + val.Value.STEP_ID + "',name:'" + val.Value.STEP_NAME + "',type:'" + val.Value.STEP_TYPE + "'}";
                    sbMap.Append("<div class='step type-" + val.Value.STEP_TYPE + "' data=\"" + data + "\"><b>" + val.Value.STEP_NAME + "</b>");
                    sbMap.Append("</div>");
                }
                litSteps.Text = sbMap.ToString();
            }
        }
        Page.Title = title;
    }
Exemple #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write("111");
        //Response.End();
        //return;
        if (Request["addNewToRow"] != null)
        {
            #region//添加新节点节点---a,b和d之间插入节点c:
            //删除连接到节点c的路径[code1];删除原来 a,b和d之间的路径[code2];插入a,b和c之间,c和d之间的路径[code3]。
            //
            WF_STEP_TPL valObj = new WF_STEP_TPL();
            try
            {
                int wfid     = Convert.ToInt32(Request["WFID"]);
                int procid   = Convert.ToInt32(Request["PROCID"]);
                int steptype = 1;
                if (Request["STEP_TYPE"] != null)
                {
                    steptype = Convert.ToInt32(Request["STEP_TYPE"]);
                }

                valObj.WFID = wfid;
                if (Request["STEP_NAME"] != null)
                {
                    valObj.STEP_NAME = Request["STEP_NAME"];
                }
                valObj.PROCID = procid;

                valObj.STEP_TYPE = steptype;

                valObj.NOTE = "";

                valObj.CONDITION = "";
                valObj.FORMULAR  = "";
                //新增节点,成功的话,再增加线段。
                int count = BLLTable <WF_STEP_TPL> .Factory(conn).Insert(valObj, WF_STEP_TPL.Attribute.STEP_ID);

                if (count > 0)
                {
                    int stepid = valObj.STEP_ID;

                    #region//code1
                    WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                    delOld.WFID      = wfid;
                    delOld.PROCID    = procid;
                    delOld.PATH_TYPE = 1;
                    delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                    BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(delOld);

                    #endregion

                    string previds = Request["PrevIDS"];
                    string nextids = Request["NextIDS"];
                    if (!string.IsNullOrEmpty(previds) && !string.IsNullOrEmpty(nextids))
                    {
                        string[] arr1 = StringHelper.GetStringArray(previds, ',');
                        string[] arr2 = StringHelper.GetStringArray(nextids, ',');
                        if (arr2 != null && arr1 != null)
                        {
                            if (Request["delOld"] != null)
                            {
                                #region//code2
                                //因为再节点之间插入了新节点,所以要删除 原节点之间的路径
                                WF_STEPATH_TPL delObj = new WF_STEPATH_TPL();
                                delObj.WFID      = wfid;
                                delObj.PROCID    = procid;
                                delObj.PATH_TYPE = 1;
                                for (int i = 0; i < arr1.Length; i++)
                                {
                                    for (int j = 0; j < arr2.Length; j++)
                                    {
                                        delObj.STEP_ID = int.Parse(arr1[i]);
                                        delObj.NEXT_ID = int.Parse(arr2[j]);

                                        BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(delObj);
                                    }
                                }
                                #endregion//
                            }
                        }
                        #region//code3
                        WF_STEPATH_TPL pathVal = new WF_STEPATH_TPL();
                        pathVal.WFID      = wfid;
                        pathVal.PROCID    = procid;
                        pathVal.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));

                        if (arr1 != null)
                        {
                            for (int i = 0; i < arr1.Length; i++)
                            {
                                pathVal.STEP_ID = int.Parse(arr1[i]);
                                string tp = BLLTable <WF_STEP_TPL> .Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, pathVal.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);

                                if (!string.IsNullOrEmpty(tp))
                                {
                                    pathVal.NODE_TYPE = int.Parse(tp);
                                }
                                pathVal.NEXT_ID = stepid;
                                if (!BLLTable <WF_STEPATH_TPL> .Exists(pathVal))
                                {
                                    pathVal.CONDITION = "";
                                    pathVal.FORMULAR  = "";
                                    count            += BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }

                        if (arr2 != null)
                        {
                            for (int i = 0; i < arr2.Length; i++)
                            {
                                pathVal.NODE_TYPE = steptype;
                                pathVal.STEP_ID   = stepid;
                                pathVal.NEXT_ID   = int.Parse(arr2[i]);
                                if (!BLLTable <WF_STEPATH_TPL> .Exists(pathVal))
                                {
                                    pathVal.CONDITION = "";
                                    pathVal.FORMULAR  = "";
                                    count            += BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(pathVal, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }

                        #endregion
                    }

                    Response.Write(stepid.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }
        if (Request["UpdateStepName"] != null) //更新节点名
        {
            #region                            //添加节点
            try
            {
                int count = BLLTable <WF_STEP_TPL> .Factory(conn).Update(WF_STEP_TPL.Attribute.STEP_ID, Request["STEP_ID"], WF_STEP_TPL.Attribute.STEP_NAME, Request["STEP_NAME"]);

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }

        /*
         * c节点移到a,b和d之间:
         * 删除原来连接到节点c的路径[code1];
         * 如果移动c导致a,b和c之间增加了一个步骤行,既没有移动到d所在的行,则要删除原来a,b和d之间的路径[code2]。
         * 插入a,b和c之间,c和d之间的路径[code3]。
         */
        if (Request["UpdateStepPath"] != null) //更新线段
        {
            #region                            //更新节点之间的路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count  = 0;
                int wfid   = Convert.ToInt32(Request["WFID"]);
                int procid = Convert.ToInt32(Request["PROCID"]);
                int stepid = Convert.ToInt32(Request["STEP_ID"]);

                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));;

                string previds = Request["PrevIDS"];
                string nextids = Request["NextIDS"];

                valObj.WFID   = wfid;
                valObj.PROCID = procid;
                string[] arr1 = StringHelper.GetStringArray(previds, ',');
                string[] arr2 = StringHelper.GetStringArray(nextids, ',');

                if (stepid > 0)
                {
                    #region//code1
                    WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                    delOld.WFID      = wfid;
                    delOld.PROCID    = procid;
                    delOld.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));;
                    delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                    BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(delOld);

                    #endregion

                    if (Request["delOld"] != null)
                    {
                        if (arr1 != null && arr2 != null)
                        {
                            #region//code2
                            WF_STEPATH_TPL delObj = new WF_STEPATH_TPL();
                            delObj.WFID      = wfid;
                            delObj.PROCID    = procid;
                            delObj.PATH_TYPE = int.Parse(WFEnum.PathType.Normal.ToString("d"));;
                            for (int i = 0; i < arr1.Length; i++)
                            {
                                for (int j = 0; j < arr2.Length; j++)
                                {
                                    delObj.STEP_ID = int.Parse(arr1[i]);
                                    delObj.NEXT_ID = int.Parse(arr2[j]);

                                    BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(delObj);
                                }
                            }
                            #endregion//
                        }
                    }
                    #region//code3
                    if (arr1 != null)
                    {
                        for (int i = 0; i < arr1.Length; i++)
                        {
                            valObj.STEP_ID = int.Parse(arr1[i]);
                            string tp = BLLTable <WF_STEP_TPL> .Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);

                            if (!string.IsNullOrEmpty(tp))
                            {
                                valObj.NODE_TYPE = int.Parse(tp);
                            }
                            valObj.NEXT_ID = stepid;
                            if (!BLLTable <WF_STEPATH_TPL> .Exists(valObj))
                            {
                                valObj.CONDITION = "";
                                valObj.FORMULAR  = "";
                                count           += BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                            }
                        }
                    }

                    if (arr2 != null)
                    {
                        for (int i = 0; i < arr2.Length; i++)
                        {
                            valObj.STEP_ID = stepid;
                            string tp = BLLTable <WF_STEP_TPL> .Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);

                            if (!string.IsNullOrEmpty(tp))
                            {
                                valObj.NODE_TYPE = int.Parse(tp);
                            }
                            valObj.NEXT_ID = int.Parse(arr2[i]);
                            if (!BLLTable <WF_STEPATH_TPL> .Exists(valObj))
                            {
                                valObj.CONDITION = "";
                                valObj.FORMULAR  = "";
                                count           += BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                            }
                        }
                    }

                    #endregion
                }

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }
        //添加返回路径
        if (Request["AddBackLine"] != null)
        {
            #region//添加返回路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                valObj.WFID      = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID    = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.BackTo.ToString("d"));

                valObj.NEXT_ID = Convert.ToInt32(Request["NEXT_ID"]);
                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);
                string tp = BLLTable <WF_STEP_TPL> .Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);

                if (!string.IsNullOrEmpty(tp))
                {
                    valObj.NODE_TYPE = int.Parse(tp);
                }
                valObj.CONDITION = "";
                valObj.FORMULAR  = "";
                count            = BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }

        if (Request["GetBackNextIDS"] != null)
        {
            #region//添加返回路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                valObj.WFID      = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID    = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = int.Parse(WFEnum.PathType.BackTo.ToString("d"));;

                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);

                WF_STEPATH_TPL vvv = new WF_STEPATH_TPL();
                vvv.NEXT_ID = 0;
                List <WF_STEPATH_TPL> lst = BLLTable <WF_STEPATH_TPL> .Factory(conn).Select(vvv, valObj);

                //WF_STEPATH_TPL ooo = BLLTable<WF_STEPATH_TPL>.Factory(conn).GetRowData(new WF_STEPATH_TPL(WF_STEPATH_TPL.Attribute.NEXT_ID), valObj);

                if (lst != null)
                {
                    string str = "";
                    for (int i = 0; i < lst.Count; i++)
                    {
                        str += "," + lst[i].NEXT_ID;
                    }
                    Response.Write(str);
                }
                else
                {
                    //Response.Write("0");
                }
            }
            catch
            {
                //Response.Write("-1");
            }
            #endregion
        }
        if (Request["delLine"] != null)
        {
            #region//删除指定类型的路径
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count = 0;
                valObj.WFID      = Convert.ToInt32(Request["WFID"]);
                valObj.PROCID    = Convert.ToInt32(Request["PROCID"]);
                valObj.PATH_TYPE = Convert.ToInt32(Request["PATH_TYPE"]);

                valObj.NEXT_ID = Convert.ToInt32(Request["NEXT_ID"]);
                valObj.STEP_ID = Convert.ToInt32(Request["STEP_ID"]);

                count = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(valObj);

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }
        if (Request["delStep"] != null)
        {
            #region//删除节点
            WF_STEP_TPL valObj = new WF_STEP_TPL();
            try
            {
                int count = WFAdmin.delStep(Convert.ToInt32(Request["STEP_ID"]));

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }
        if (Request["delStepInPath"] != null)
        {
            #region//图形界面里删除节点

            /*
             * 删除a,b和d之间的节点c:
             * 删除原来连接到节点c的路径[code1];
             * 如果c没有兄弟节点,参数PrevIDS和NextIDS不会为空,则插入a,b和d之间的路径[code2]。
             */
            WF_STEPATH_TPL valObj = new WF_STEPATH_TPL();
            try
            {
                int count  = 0;
                int wfid   = Convert.ToInt32(Request["WFID"]);
                int procid = Convert.ToInt32(Request["PROCID"]);
                int stepid = Convert.ToInt32(Request["STEP_ID"]);

                #region//code1
                WF_STEPATH_TPL delOld = new WF_STEPATH_TPL();
                delOld.WFID      = wfid;
                delOld.PROCID    = procid;
                delOld.PATH_TYPE = 1;
                delOld.Where("(STEP_ID=" + stepid + " or NEXT_ID=" + stepid + ")");
                count = BLLTable <WF_STEPATH_TPL> .Factory(conn).Delete(delOld);

                #endregion

                string previds = Request["PrevIDS"];
                string nextids = Request["NextIDS"];
                if (!string.IsNullOrEmpty(previds) && !string.IsNullOrEmpty(nextids))
                {
                    valObj.WFID   = wfid;
                    valObj.PROCID = procid;
                    string[] arr1 = StringHelper.GetStringArray(previds, ',');
                    string[] arr2 = StringHelper.GetStringArray(nextids, ',');

                    #region//code2

                    if (arr1 != null && arr2 != null)
                    {
                        for (int i = 0; i < arr1.Length; i++)
                        {
                            for (int j = 0; j < arr2.Length; j++)
                            {
                                valObj.STEP_ID = int.Parse(arr1[i]);
                                string tp = BLLTable <WF_STEP_TPL> .Factory(conn).GetOneValue(WF_STEP_TPL.Attribute.STEP_ID, valObj.STEP_ID, WF_STEP_TPL.Attribute.STEP_TYPE);

                                if (!string.IsNullOrEmpty(tp))
                                {
                                    valObj.NODE_TYPE = int.Parse(tp);
                                }
                                valObj.NEXT_ID   = int.Parse(arr2[j]);
                                valObj.PATH_TYPE = 1;
                                if (!BLLTable <WF_STEPATH_TPL> .Exists(valObj))
                                {
                                    valObj.CONDITION = "";
                                    valObj.FORMULAR  = "";
                                    count           += BLLTable <WF_STEPATH_TPL> .Factory(conn).Insert(valObj, WF_STEPATH_TPL.Attribute.PATH_ID);
                                }
                            }
                        }
                    }

                    #endregion
                }

                if (count > 0)
                {
                    Response.Write(count.ToString());
                }
                else
                {
                    Response.Write("0");
                }
            }
            catch
            {
                Response.Write("-1");
            }
            #endregion
        }
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        if (Request["STEP_ID"] != null)
        {
            stepid = int.Parse(Request["STEP_ID"]);
        }
        title = "��̽ڵ�";
        Page.Title = title;
        if (!IsPostBack)
        {

            MemCacheSerivce.SetVersion(WF_PROCESS_EXD_TPL.getTableName(procid));

            WFSTEP_EXD_TPL step = WF_PROCESS_EXD_TPL.GetWFSTEP_EXD(procid, stepid);

            //����
            listObj = step.WF_STEPATH_Out;

            foreach (WF_STEPATH_TPL tp1 in listObj)
            {
                //�����-ͨ����
                if (tp1.PATH_TYPE == 1)
                    listObj1.Add(tp1);
                else if (tp1.PATH_TYPE == 2)//��ת��
                    listObj2.Add(tp1);
                else if (tp1.PATH_TYPE == 3)//�ٳ���-�˻���
                    listObj3.Add(tp1);
            }

            rep1.DataSource = listObj1;
            rep1.DataBind();
            rep2.DataSource = listObj2;
            rep2.DataBind();
            rep3.DataSource = listObj3;
            rep3.DataBind();

            rep0.DataSource = step.WF_STEPATH_In;
            rep0.DataBind();

            //·�� �� �������� //zlg
            step1 = BLLTable<WF_STEP_TPL>.GetRowData(WF_STEP_TPL.Attribute.STEP_ID, stepid);
            {
                txtCONDITION.Value = step1.CONDITION;// ����:[{0:��},{1:��},{2:ͨ������},{3:�Զ��幫ʽ(&&||)}]
                txtFORMULAR.Value = step1.FORMULAR;// ��ʽ
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        title = valObj._ZhName + "管理  ";

        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
        }
        else
        {
            if (!string.IsNullOrEmpty(Request["PROCID"]))
            {
                procid = int.Parse(Request["PROCID"]);
                WF_PROCESS_TPL proc = BLLTable <WF_PROCESS_TPL> .Factory(conn).GetRowData(WF_PROCESS_TPL.Attribute.PROCID, procid);

                wfid   = proc.WFID;
                title += proc.PROC_NAME + "-";
            }
            else
            {
                Response.Write("非法连接!");
                Response.End();
            }
        }
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
        }
        else
        {
            List <WF_PROCESS_TPL> lstProc = BLLTable <WF_PROCESS_TPL> .Factory(conn).Select(WF_PROCESS_TPL.Attribute.WFID, wfid);

            if (lstProc.Count > 0)
            {
                procid = lstProc[0].PROCID;
                title += lstProc[0].PROC_NAME + "-";
            }
            else
            {
                ScriptHelper.AlertAndGo(Page, "此流程未配置过程!", "../PROCESS/PROCESSManage.aspx?WFID=" + wfid);
            }
        }
        if (!IsPostBack)
        {
            #region//数据初始化

            WF_STEP_TPL rule_b = new WF_STEP_TPL();
            rule_b.WFID      = wfid;
            rule_b.PROCID    = procid;
            rule_b.STEP_TYPE = 0;

            WF_STEP_TPL bObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(new WF_STEP_TPL(), rule_b);

            if (bObj == null)
            {
                rule_b.CONDITION = "";
                rule_b.FORMULAR  = "";
                rule_b.STEP_NAME = "开始";
                BLLTable <WF_STEP_TPL> .Factory(conn).Insert(rule_b, WF_STEP_TPL.Attribute.STEP_ID);

                bObj = rule_b;
            }
            litB.Text = bObj.STEP_NAME;
            beginID   = bObj.STEP_ID;

            WF_STEP_TPL rule_e = new WF_STEP_TPL();
            rule_e.WFID      = wfid;
            rule_e.PROCID    = procid;
            rule_e.STEP_TYPE = 3;

            WF_STEP_TPL eObj = BLLTable <WF_STEP_TPL> .Factory(conn).GetRowData(new WF_STEP_TPL(), rule_e);

            if (eObj == null)
            {
                rule_e.CONDITION = "";
                rule_e.FORMULAR  = "";
                rule_e.STEP_NAME = "结束";
                BLLTable <WF_STEP_TPL> .Factory(conn).Insert(rule_e, WF_STEP_TPL.Attribute.STEP_ID);

                eObj = rule_e;
            }
            litE.Text = eObj.STEP_NAME;
            endID     = eObj.STEP_ID;

            WF_INFO wf = BLLTable <WF_INFO> .Factory(conn).GetRowData(WF_INFO.Attribute.WFID, wfid);

            if (wf.STATUS != "1")
            {
                btnApplyTo.Enabled    = false;
                btnApplyProc.Disabled = true;
            }
            #endregion

            Dictionary <int, WF_STEP_TPL> noUseSTep = new Dictionary <int, WF_STEP_TPL>();
            //流程图形设计器:
            litStepMap.Text = WFAdmin.ShowStepPathMap(wfid, procid, out noUseSTep);

            if (noUseSTep.Count > 0)
            {
                StringBuilder sbMap = new StringBuilder();
                foreach (KeyValuePair <int, WF_STEP_TPL> val in noUseSTep)
                {
                    string data = "{id:'" + val.Value.STEP_ID + "',name:'" + val.Value.STEP_NAME + "',type:'" + val.Value.STEP_TYPE + "'}";
                    sbMap.Append("<div class='step type-" + val.Value.STEP_TYPE + "' data=\"" + data + "\"><b>" + val.Value.STEP_NAME + "</b>");
                    sbMap.Append("</div>");
                }
                litSteps.Text = sbMap.ToString();
            }
        }
        Page.Title = title;
    }
    int DelPROC(int wfid,int procid,ref string msg)
    {
        WF_STEP_TPL condStep = new WF_STEP_TPL();
        condStep.WFID = wfid;
        condStep.PROCID = procid;
        condStep.STEP_TYPE = 1;
        if (BLLTable<WF_STEP_TPL>.Exists(condStep))
        {
            msg = "{re:0,msg:'���ڲ��裬����ɾ��!'}";
            return 0;
        }
        else {
            WF_PROCESS_TPL delCond = new WF_PROCESS_TPL();
            delCond.WFID = wfid;
            delCond.PROCID = procid;
            msg = "{re:1,msg:'ɾ���ɹ�!'}";
            int re= BLLTable<WF_PROCESS_TPL>.Factory(conn).Delete(delCond);
            if (re > 0) {
                WF_STEP_TPL ccc = new WF_STEP_TPL();
                ccc.WFID = wfid;
                ccc.PROCID = procid;
                BLLTable<WF_STEP_TPL>.Factory(conn).Delete(ccc);

                WF_CHECKER_TPL ccc1 = new WF_CHECKER_TPL();
                ccc1.WFID = wfid;
                ccc1.PROCID = procid;
                BLLTable<WF_CHECKER_TPL>.Factory(conn).Delete(ccc1);
            }
            return re;
        }
    }
Exemple #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["PROCID"]))
        {
            procid = int.Parse(Request["PROCID"]);
            condObj.PROCID = procid;
            condObj_Step.PROCID = procid;
        }
        if (!string.IsNullOrEmpty(Request["WFID"]))
        {
            wfid = int.Parse(Request["WFID"]);
            condObj.WFID = wfid;
            condObj_Step.WFID = wfid;
        }
        if (Request["STEP_ID"] != null)
        {
            stepid = int.Parse(Request["STEP_ID"]);
            //condObj_Step.STEP_ID = stepid;
        }
        if (Request["STEP_TYPE"] != null)
        {
            STEP_TYPE = int.Parse(Request["STEP_TYPE"]);
            //condObj.STEP_TYPE = STEP_TYPE;//�������� ·�ɽڵ㣬���ڵ�
            condObj_Step.NODE_TYPE = STEP_TYPE;
        }
        valObj.OrderBy(WF_STEP_TPL.Attribute.STEP_ID, Order.Asc);
        valObj_Step.OrderBy(WF_STEPATH_TPL.Attribute.STEP_ID, Order.Asc);
        //if (Request["NEXT_ID"] != null)
        //{
        //    NEXT_ID = int.Parse(Request["NEXT_ID"]);
        //    condObj_Step.NEXT_ID = NEXT_ID;
        //}
        if (Request["PATH_TYPE"] != null)
        {
            PATH_TYPE = int.Parse(Request["PATH_TYPE"]);
            condObj_Step.PATH_TYPE = PATH_TYPE;
        }

        //���ѡȡ��ڵ�
        if (STEP_TYPE == 1)
        {
            condObj.STEP_TYPE = STEP_TYPE;

            //�����µ�ʱ���ж��ã��������� 1������� 3���ٳ��� 0�����
            PATH_TYPE = 0;
        }
        else
        {
            //�ٳ���ѡȡ·�ɽڵ�
            if (PATH_TYPE == 3)
            {
                condObj.STEP_TYPE = STEP_TYPE;
            }
        }

        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request["STEP_ID"]) || !string.IsNullOrEmpty(Request["NEXT_ID"]))
            {
                List<WF_STEPATH_TPL> lstPath = new List<WF_STEPATH_TPL>();
                //
                WF_STEP_TPL vvv = new WF_STEP_TPL();
                vvv.STEP_NAME = "";
                vvv.STEP_ID = 0;
                if (STEP_TYPE == 1)
                {
                    condObj_Step.NEXT_ID = stepid;
                    //����ڽڵ㣬���������ҵ� ���
                    lstPath = BLLTable<WF_STEPATH_TPL>.Factory(conn).Select(valObj_Step, new Relation(WF_STEPATH_TPL.Attribute.STEP_ID, WF_STEP_TPL.Attribute.STEP_ID, RelationType.LeftJoin),
                        vvv, condObj_Step);
                }
                else  //�ҳ��ڽڵ�
                {
                    condObj_Step.STEP_ID = stepid;
                    lstPath = BLLTable<WF_STEPATH_TPL>.Factory(conn).Select(valObj_Step, new Relation(WF_STEPATH_TPL.Attribute.NEXT_ID, WF_STEP_TPL.Attribute.STEP_ID, RelationType.LeftJoin),
                         vvv, condObj_Step);
                }

                BLLTable.SQL_Test.ToString();

                //������ѡ�е���
                if (lstPath != null)
                {
                    for (int i = 0; i < lstPath.Count; i++)
                    {
                        if (i > 0)
                        {
                            hidOld.Value += ",";
                            hidInitIDS.Value += ",";
                        }
                        {
                            hidOld.Value += "{ID:'" + lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_ID) + "',Name:'" + lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_NAME) + "'}";//�����Name������ʾ���б��У��������ض��塣
                            hidInitIDS.Value += lstPath[i].GetValue(WF_STEP_TPL.Attribute.STEP_ID);
                        }
                    }
                }
            }
            try
            {
                listObj = BLLTable<WF_STEP_TPL>.Factory(conn).Select(valObj, condObj);
                repList.DataSource = listObj;
                repList.DataBind();
            }
            catch (Exception ex)
            {
                 litWarn.Text = ex.Message;
            }
        }
    }