/// <summary>
        /// 初始化
        /// </summary>
        /// <returns></returns>
        public string CondByStation_Init()
        {
            DataSet ds = new DataSet();

            //岗位类型.
            BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
            tps.RetrieveAll();
            ds.Tables.Add(tps.ToDataTableField("StationTypes"));

            //岗位.
            BP.GPM.Stations sts = new BP.GPM.Stations();
            sts.RetrieveAll();
            ds.Tables.Add(sts.ToDataTableField("Stations"));


            //取有可能存盘的数据.
            int    FK_MainNode = this.GetRequestValInt("FK_MainNode");
            int    ToNodeID    = this.GetRequestValInt("ToNodeID");
            Cond   cond        = new Cond();
            string mypk        = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString();

            cond.MyPK = mypk;
            cond.RetrieveFromDBSources();
            ds.Tables.Add(cond.ToDataTableField("Cond"));

            return(BP.Tools.Json.DataSetToJson(ds, false));
        }
        public string CondPRI_Move()
        {
            switch (this.GetRequestVal("MoveType"))
            {
            case "Up":
                Cond up = new Cond(this.MyPK);
                up.DoUp(this.FK_Node);
                up.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + up.PRI + " WHERE ToNodeID=" + up.ToNodeID);
                break;

            case "Down":
                Cond down = new Cond(this.MyPK);
                down.DoDown(this.FK_Node);
                down.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + down.PRI + " WHERE ToNodeID=" + down.ToNodeID);
                break;

            default:
                break;
            }


            Conds cds = new Conds();

            cds.Retrieve(CondAttr.FK_Node, this.FK_Node, CondAttr.CondType, 2, CondAttr.PRI);
            return(cds.ToJson());
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            this.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.AddTR();
            this.AddTD("class='GroupTitle'", "设置SQL");
            this.AddTREnd();

            AddTR();

            TextBox tb = new TextBox();

            tb.ID       = "TB_SQL";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 10;
            tb.Columns  = 80;
            tb.Style.Add("width", "99%");
            tb.Text = cond.OperatorValueStr;
            AddTD("", tb);

            AddTREnd();
            AddTableEnd();

            AddBR();
            AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddBR();
            AddBR();

            string help = "";

            help += "<ul>";
            help += "<li>在文本框里设置一个查询SQL,它返回一行一列。比如: SELECT COUNT(*) AS Num FROM MyTable WHERE NAME='@MyFieldName'。 </li>";
            help += "<li>该SQL参数支持系统的表达式,什么是ccflow的表达式请查看说明书。</li>";
            help += "<li>当前登录信息变量: @WebUser.No,  @WebUser.Name, @WebUser.FK_Dept.</li>";
            help += "<li>系统就会获取该返回的值把它转化为decimal类型</li>";
            help += "<li>如果该值大于零,该条件就是成立的否则不成立。</li>";
            help += "</ul>";
            AddEasyUiPanelInfo("帮助", help);
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public string CondByStation_Save()
        {
            int      FK_MainNode = this.GetRequestValInt("FK_MainNode");
            int      ToNodeID    = this.GetRequestValInt("ToNodeID");
            CondType HisCondType = CondType.Dir;

            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, FK_MainNode,
                        CondAttr.ToNodeID, ToNodeID,
                        CondAttr.CondType, (int)HisCondType);

            string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString();

            //把其他的条件都删除掉.
            DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)HisCondType + " AND  NodeID=" + this.FK_Node + " AND ToNodeID=" + ToNodeID + ") AND DataFrom!=" + (int)ConnDataFrom.Stas);

            // 删除岗位条件.
            cond.MyPK = mypk;
            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Stas;
                cond.NodeID      = FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = ToNodeID;
                cond.Insert();
            }

            string val  = this.GetRequestVal("emps").Replace(",", "@");
            string valT = this.GetRequestVal("orgEmps").Replace(",", "&nbsp;&nbsp;");

            cond.OperatorValue = val;
            //cond.OperatorValueT = valT;
            cond.SetPara("OrgEmps", valT);
            cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay");
            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara");
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            cond.HisDataFrom = ConnDataFrom.Stas;
            cond.FK_Flow     = this.FK_Flow;
            cond.HisCondType = CondType.Dir;
            cond.FK_Node     = FK_MainNode;

            cond.ToNodeID = ToNodeID;
            cond.Update();

            return("保存成功..");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            this.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.AddTR();
            this.AddTD("class='GroupTitle'", "设置CCFlow要求格式的系统参数");
            this.AddTREnd();

            TextBox tb = new TextBox();

            tb.ID       = "TB_Para";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 1;
            tb.Columns  = 80;
            tb.Style.Add("width", "99%");
            tb.Text = cond.OperatorValueStr;
            AddTD("", tb);

            AddTREnd();
            AddTableEnd();

            AddBR();
            AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddBR();
            AddBR();

            AddEasyUiPanelInfo("说明", "表达式格式:参数+空格+操作符+空格+值,仅支持一个表达式。格式如下:<br />" + Environment.NewLine
                               + "<ul>" + Environment.NewLine
                               + "<li>Emp = zhangsan</li>" + Environment.NewLine
                               + "<li>JinE = 30</li>" + Environment.NewLine
                               + "<li>JinE >= 30</li>" + Environment.NewLine
                               + "<li>JinE > 30</li>" + Environment.NewLine
                               + "<li>Way = '1'</li>" + Environment.NewLine
                               + "<li>Way != '1'</li>" + Environment.NewLine
                               + "<li>Name LIKE %li%</li>" + Environment.NewLine
                               + "</ul>" + Environment.NewLine);
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "按参数设置";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            this.AddBR();
            this.AddBR();

            this.AddFieldSet("设置ccflow要求格式的系统参数");
            TextBox tb = new TextBox();

            tb.ID       = "TB_Para";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 1;
            tb.Columns  = 80;
            tb.Text     = cond.OperatorValueStr;
            this.Add(tb);
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";
            this.AddBR();
            this.Add(btn);
            btn.Click += new EventHandler(btn_Click);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Delete";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);

            this.AddHR();
            this.Add("<b>说明:</b> 表达式格式: 参数+空格+操作符+空格+值 , 仅支持一个表达式.<br>");
            this.AddUL();
            this.AddLi("Emp = zhangsan ");
            this.AddLi("JinE = 30 ");
            this.AddLi("JinE >= 30 ");
            this.AddLi("JinE > 30 ");
            this.AddLi("Way = '1' ");
            this.AddLi("Way != '1' ");
            this.AddLi("Name LIKE  %li% ");
            this.AddULEnd();
            this.AddFieldSetEnd();
        }
Exemple #7
0
        public string CondByDept_Save()
        {
            int      FK_MainNode = this.GetRequestValInt("FK_MainNode");
            int      ToNodeID    = this.GetRequestValInt("ToNodeID");
            CondType condType    = (CondType)this.GetRequestValInt("CondType");

            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, this.GetRequestValInt("FK_MainNode"),
                        CondAttr.ToNodeID, this.GetRequestValInt("ToNodeID"),
                        CondAttr.CondType, (int)condType);


            string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString();

            cond.MyPK = mypk;

            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Depts;
                cond.NodeID      = this.GetRequestValInt("FK_MainNode");
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.GetRequestValInt("ToNodeID");
                cond.Insert();
            }

            string val = this.GetRequestVal("depts").Replace(",", "@");

            cond.OperatorValue = val;
            cond.SpecOperWay   = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay");
            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara");
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            cond.HisDataFrom = ConnDataFrom.Depts;
            cond.FK_Flow     = this.FK_Flow;
            cond.HisCondType = CondType.Dir;
            cond.FK_Node     = FK_MainNode;

            cond.ToNodeID = ToNodeID;
            cond.Update();

            return("保存成功!!");
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Page.Title = "按SQL设置";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            this.AddBR();
            this.AddBR();

            this.AddFieldSet("设置SQL");
            TextBox tb = new TextBox();

            tb.ID       = "TB_SQL";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 10;
            tb.Columns  = 80;
            tb.Text     = cond.OperatorValueStr;
            this.Add(tb);
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";
            this.AddBR();
            this.Add(btn);
            btn.Click += new EventHandler(btn_Click);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Delete";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);

            this.AddHR();
            this.Add("<b>说明:</b>在文本框里设置一个SQL,它返回一行一列,此值必须为0或大于等于1的正<BR>整数, 来表示该条件是否成立。SQL 支持ccflow的表达式。");
            this.AddFieldSetEnd();

            //this.AddTable();
            //this.AddTR();
            //this.AddTDTitle("数据");
            //this.AddTREnd();
            //this.AddTableEnd();
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <returns></returns>
        public string CondBySQL_Init()
        {
            string fk_mainNode = this.GetRequestVal("FK_MainNode");
            string toNodeID    = this.GetRequestVal("ToNodeID");

            CondType condTypeEnum = (CondType)this.GetRequestValInt("CondType");

            string mypk = fk_mainNode + "_" + toNodeID + "_" + condTypeEnum + "_" + ConnDataFrom.SQL.ToString();

            Cond cond = new Cond();

            cond.MyPK = mypk;
            cond.RetrieveFromDBSources();

            return(cond.ToJson());
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            this.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.AddTR();
            this.AddTD("class='GroupTitle'", "设置一个URL,此Url返回一个数值,用与判断该方向是否通过");
            this.AddTREnd();

            AddTR();

            TextBox tb = new TextBox();

            tb.ID      = "TB_Para";
            tb.Rows    = 1;
            tb.Columns = 80;
            tb.Style.Add("width", "99%");
            tb.Text = cond.OperatorValueStr;
            AddTD("", tb);

            AddTREnd();
            AddTableEnd();

            AddBR();
            AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = "return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Click);
            this.Add(btn);
            AddBR();
            AddBR();



            AddEasyUiPanelInfo("帮助", "格式: http://xxxx/xxx.xxx?s=sss , 此url返回小于等于0是不通过,大于等于1是通过。系统在调用此url时会向它传入4大参数:FK_Flow,FK_Node,WorkID,FID您通过这四个参数,您可以获得当前流程数据。");
            // 还有WebUser.No,SID两个校验参数,
        }
        public string CondByDept_Save()
        {
            int      FK_MainNode = this.GetRequestValInt("FK_MainNode");
            int      ToNodeID    = this.GetRequestValInt("ToNodeID");
            CondType condType    = (CondType)this.GetRequestValInt("CondType");

            Cond cond = new Cond();

            //把其他的条件都删除掉.
            DBAccess.RunSQL("DELETE FROM WF_Cond WHERE (CondType=" + (int)condType + " AND  NodeID=" + this.FK_Node + " AND ToNodeID=" + this.GetRequestValInt("ToNodeID") + ") AND DataFrom!=" + (int)ConnDataFrom.Depts);

            string mypk = this.GetRequestValInt("FK_MainNode") + "_" + this.GetRequestValInt("ToNodeID") + "_" + condType.ToString() + "_" + ConnDataFrom.Depts.ToString();

            cond.MyPK = mypk;

            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Depts;
                cond.NodeID      = this.GetRequestValInt("FK_MainNode");
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.GetRequestValInt("ToNodeID");
                cond.Insert();
            }

            string val = this.GetRequestVal("depts").Replace(",", "@");

            cond.OperatorValue = val;
            cond.SpecOperWay   = (SpecOperWay)this.GetRequestValInt("DDL_SpecOperWay");
            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = this.GetRequestVal("TB_SpecOperPara");
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            cond.HisDataFrom = ConnDataFrom.Depts;
            cond.FK_Flow     = this.FK_Flow;
            cond.HisCondType = CondType.Dir;
            cond.FK_Node     = FK_MainNode;

            cond.ToNodeID = ToNodeID;
            cond.Update();

            return("保存成功!!");
        }
Exemple #12
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, this.FK_MainNode,
                        CondAttr.ToNodeID, this.ToNodeID,
                        CondAttr.CondType, (int)this.HisCondType);

            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Delete)
            {
                this.Response.Redirect(this.Request.RawUrl, true);
                return;
            }

            // 删除岗位条件.
            cond.MyPK = this.GenerMyPK;

            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Stas;
                cond.NodeID      = this.FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.ToNodeID;
                cond.Insert();
            }

            string   val = "";
            Stations sts = new Stations();

            sts.RetrieveAllFromDBSource();

            foreach (Station st in sts)
            {
                if (this.Pub1.IsExit("CB_" + st.No) == false)
                {
                    continue;
                }
                if (this.Pub1.GetCBByID("CB_" + st.No).Checked)
                {
                    val += "@" + st.No;
                }
            }

            if (val == "")
            {
                cond.Delete();
                return;
            }

            val += "@";
            cond.OperatorValue = val;
            cond.HisDataFrom   = ConnDataFrom.Stas;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_MainNode;

            switch (this.HisCondType)
            {
            case CondType.Flow:
            case CondType.Node:
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            case CondType.Dir:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            default:
                throw new Exception("未设计的情况。");
            }

            EasyUiHelper.AddEasyUiMessager(this, "保存成功!");
        }
Exemple #13
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            //this.AddTable("border=0 widht='500px'");
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTD("class='GroupTitle' style='width:80px'", "项目");
            this.AddTD("class='GroupTitle' style='width:200px'", "采集");
            this.AddTD("class='GroupTitle'", "描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }
            ddl    = new DDL();
            ddl.ID = "DDL_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();

            this.AddTableEnd();
            this.AddBR();
            this.AddSpace(1);

            var btn = new LinkBtn(false, "Btn_SaveAnd", "保存为And条件");

            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, "Btn_SaveOr", "保存为Or条件");
            btn.SetDataOption("iconCls", "'icon-save'");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);
            this.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);

            this.AddBR();
            this.AddBR();

            if (num == 0)
            {
                return;
            }

            #region 条件
            this.AddTable("class='Table' cellpadding='2' cellspacing='2' style='width:100%;'");
            this.AddTR();
            this.AddTDTitleGroup("序");
            this.AddTDTitleGroup("节点");
            this.AddTDTitleGroup("字段的英文名");
            this.AddTDTitleGroup("字段的中文名");
            this.AddTDTitleGroup("操作符");
            this.AddTDTitleGroup("值");
            this.AddTDTitleGroup("标签");
            this.AddTDTitleGroup("运算关系");
            this.AddTDTitleGroup("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);
                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);

                if (mync.CondOrAnd == CondOrAnd.ByAnd)
                {
                    this.AddTD("AND");
                }
                else
                {
                    this.AddTD("OR");
                }

                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' class='easyui-linkbutton' data-options=\"iconCls:'icon-remove'\" onclick=\"return confirm('确定删除此条件吗?')\">删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            this.AddBR();

            AddEasyUiPanelInfo("说明", "在上面的条件集合中ccflow仅仅支持要么是And,要么是OR的两种情形,高级的开发就需要事件来支持条件转向,或者采用其他的方式。");

            #endregion
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Left.AddFieldSet("帮助");
            this.Left.AddB("什么是方向条件的优先级?");
            this.Left.AddHR();
            this.Left.Add("在方向条件判定中,ccflow会把方向条件按照优先级别排序进行计算。这种情况通常是在采用多个字段设置方向条件。");
            this.Left.AddFieldSetEnd();

            switch (this.DoType)
            {
            case "Up":
                Cond up = new Cond(this.MyPK);
                up.DoUp(this.FK_MainNode);
                up.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + up.PRI + " WHERE ToNodeID=" + up.ToNodeID);
                break;

            case "Down":
                Cond down = new Cond(this.MyPK);
                down.DoDown(this.FK_MainNode);
                down.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + down.PRI + " WHERE ToNodeID=" + down.ToNodeID);
                break;

            default:
                break;
            }


            BP.WF.Node nd = new BP.WF.Node(this.FK_MainNode);
            this.Pub1.AddTable();
            this.Pub1.AddCaptionLeft(nd.Name);
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("从节点ID");
            this.Pub1.AddTDTitle("从节点名称");
            this.Pub1.AddTDTitle("到节点ID");
            this.Pub1.AddTDTitle("到节点名称");
            this.Pub1.AddTDTitle("优先级");
            this.Pub1.AddTDTitle("colspan=2", "操作");
            this.Pub1.AddTREnd();
            Conds cds = new Conds();

            //BP.En.QueryObject qo = new QueryObject(cds);
            //qo.AddWhere(CondAttr.FK_Node, this.FK_MainNode);
            //qo.addAnd();
            //qo.AddWhere(CondAttr.FK_Node, this.FK_MainNode);

            cds.Retrieve(CondAttr.FK_Node, this.FK_MainNode, CondAttr.CondType, 2, CondAttr.PRI);
            string strs = "";

            foreach (Cond cd in cds)
            {
                if (strs.Contains("," + cd.ToNodeID.ToString()))
                {
                    continue;
                }

                strs += "," + cd.ToNodeID.ToString();

                BP.WF.Node mynd = new BP.WF.Node(cd.ToNodeID);
                this.Pub1.AddTR();
                this.Pub1.AddTD(nd.NodeID);
                this.Pub1.AddTD(nd.Name);

                this.Pub1.AddTD(mynd.NodeID);
                this.Pub1.AddTD(mynd.Name);
                this.Pub1.AddTD(cd.PRI);
                this.Pub1.AddTD("<a href='CondPRI.aspx?CondType=2&DoType=Up&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + this.FK_MainNode + "&ToNodeID=" + this.ToNodeID + "&MyPK=" + cd.MyPK + "'>上移</a>");
                this.Pub1.AddTD("<a href='CondPRI.aspx?CondType=2&DoType=Down&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + this.FK_MainNode + "&ToNodeID=" + this.ToNodeID + "&MyPK=" + cd.MyPK + "'>下移</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Exemple #15
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.Delete(CondAttr.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.Depts);

            Button btn = sender as Button;

            if (btn.ID == "Btn_Del")
            {
                this.Response.Redirect(this.Request.RawUrl, true);
                return;
            }

            cond.MyPK = this.GenerMyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Depts;
                cond.NodeID      = this.FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.ToNodeID;
                cond.Insert();
            }

            string val = "";
            Depts  sts = new Depts();

            sts.RetrieveAllFromDBSource();
            foreach (Dept st in sts)
            {
                if (this.Pub1.IsExit("CB_" + st.No) == false)
                {
                    continue;
                }
                if (this.Pub1.GetCBByID("CB_" + st.No).Checked)
                {
                    val += "@" + st.No;
                }
            }
            if (val == "")
            {
                cond.Delete();
                return;
            }

            val += "@";
            cond.OperatorValue = val;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_Node;
            switch (this.HisCondType)
            {
            case CondType.Flow:
            case CondType.Node:
                cond.Update();
                this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr, true);
                return;

            case CondType.Dir:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondDept.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            default:
                throw new Exception("未设计的情况。");
            }
        }
Exemple #16
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable();
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("colspan=4", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int idx = -1;

            foreach (Dept st in sts)
            {
                idx++;
                if (idx == 0)
                {
                    this.Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (idx == 3)
                {
                    idx = -1;
                    this.Pub1.AddTREnd();
                }
            }

            switch (idx)
            {
            case 0:
                this.Pub1.AddTD();
                this.Pub1.AddTD();
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();
                break;

            case 1:
                this.Pub1.AddTD();
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();
                break;

            case 2:
                this.Pub1.AddTD();
                this.Pub1.AddTREnd();
                break;
            }


            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD class=TD colspan=4 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = "Save";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Delete";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            this.Pub1.Add("</TD>");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemple #17
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3 class='GroupTitle'", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int i = 0;

            foreach (Dept st in sts)
            {
                i++;

                if (i == 4)
                {
                    i = 1;
                }

                if (i == 1)
                {
                    Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (i == 3)
                {
                    Pub1.AddTREnd();
                }
            }

            switch (i)
            {
            case 1:
                Pub1.AddTD();
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            case 2:
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            default:
                break;
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
Exemple #18
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("width=50%");
            SysEnums ses = new SysEnums("StaGrade");
            Stations sts = new Stations();

            sts.RetrieveAll();
            foreach (SysEnum se in ses)
            {
                this.Pub1.AddTR();
                CheckBox mycb = new CheckBox();
                mycb.Text = se.Lab;
                mycb.ID   = "CB_s_d" + se.IntKey;
                this.Pub1.AddTDTitle("colspan=4", mycb);
                this.Pub1.AddTREnd();

                int    idx    = -1;
                string ctlIDs = "";
                foreach (Station st in sts)
                {
                    if (st.StaGrade != se.IntKey)
                    {
                        continue;
                    }

                    idx++;
                    if (idx == 0)
                    {
                        this.Pub1.AddTR();
                    }

                    CheckBox cb = new CheckBox();
                    cb.ID   = "CB_" + st.No;
                    ctlIDs += cb.ID + ",";
                    cb.Text = st.Name;
                    if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (idx == 3)
                    {
                        idx = -1;
                        this.Pub1.AddTREnd();
                    }
                }
                mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                switch (idx)
                {
                case 0:
                    this.Pub1.AddTD();
                    this.Pub1.AddTD();
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                    break;

                case 1:
                    this.Pub1.AddTD();
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                    break;

                case 2:
                    this.Pub1.AddTD();
                    this.Pub1.AddTREnd();
                    break;
                }
            }

            this.Pub1.AddTRSum();
            this.Pub1.Add("<TD class=TD colspan=4 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";
            btn.Click   += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Delete";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);

            this.Pub1.Add("</TD>");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();

            // this.Pub1.AddFieldSetEnd(); // ("岗位类型:条件设置");
        }
Exemple #19
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3 class='GroupTitle'", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int i = 0;

            foreach (Dept st in sts)
            {
                i++;

                if (i == 4)
                {
                    i = 1;
                }

                if (i == 1)
                {
                    Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (i == 3)
                {
                    Pub1.AddTREnd();
                }
            }

            switch (i)
            {
            case 1:
                Pub1.AddTD();
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            case 2:
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            default:
                break;
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            #region //增加“指定的操作员”选项,added by liuxc,2015-10-7
            var ddl = new DDL();
            ddl.ID    = "DDL_" + CondAttr.SpecOperWay;
            ddl.Width = 200;
            ddl.Items.Add(new ListItem("当前操作员", "0"));
            ddl.Items.Add(new ListItem("指定节点的操作员", "1"));
            ddl.Items.Add(new ListItem("指定表单字段作为操作员", "2"));
            ddl.Items.Add(new ListItem("指定操作员编号", "3"));
            ddl.SetSelectItem((int)cond.SpecOperWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            Pub1.Add("指定的操作员:");
            Pub1.Add(ddl);
            Pub1.AddBR();
            Pub1.AddBR();

            var lbl = new Label();
            lbl.ID = "LBL1";

            switch (cond.SpecOperWay)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            Pub1.Add(lbl);

            var tb = new TB();
            tb.ID      = "TB_" + CondAttr.SpecOperPara;
            tb.Width   = 200;
            tb.Text    = cond.SpecOperPara;
            tb.Enabled = cond.SpecOperWay != SpecOperWay.CurrOper;
            Pub1.Add(tb);
            Pub1.AddSpace(1);
            Pub1.Add("多个值请用英文“逗号”来分隔。");
            Pub1.AddBR();
            Pub1.AddBR();
            #endregion

            Pub1.AddSpace(1);
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
Exemple #20
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, this.FK_MainNode,
                        CondAttr.ToNodeID, this.ToNodeID,
                        CondAttr.CondType, (int)this.HisCondType);

            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Delete)
            {
                this.Response.Redirect(this.Request.RawUrl, true);
                return;
            }

            // 删除岗位条件.
            cond.MyPK = this.GenerMyPK;

            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Stas;
                cond.NodeID      = this.FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.ToNodeID;
                cond.Insert();
            }

            string   val = "";
            Stations sts = new Stations();

            sts.RetrieveAllFromDBSource();

            foreach (Station st in sts)
            {
                if (this.Pub1.IsExit("CB_" + st.No) == false)
                {
                    continue;
                }
                if (this.Pub1.GetCBByID("CB_" + st.No).Checked)
                {
                    val += "@" + st.No;
                }
            }

            if (val == "")
            {
                cond.Delete();
                return;
            }

            val += "@";
            cond.OperatorValue = val;
            cond.HisDataFrom   = ConnDataFrom.Stas;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_MainNode;

            #region //获取“指定的操作员”设置,added by liuxc,2015-10-7
            cond.SpecOperWay = (SpecOperWay)Pub1.GetDDLByID("DDL_" + CondAttr.SpecOperWay).SelectedItemIntVal;

            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = Pub1.GetTBByID("TB_" + CondAttr.SpecOperPara).Text;
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            #endregion

            switch (this.HisCondType)
            {
            case CondType.Flow:
            case CondType.Node:
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            case CondType.Dir:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            case CondType.SubFlow:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            default:
                throw new Exception("未设计的情况。");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "Up":
                Cond up = new Cond(this.MyPK);
                up.DoUp(this.FK_MainNode);
                up.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + up.PRI + " WHERE ToNodeID=" + up.ToNodeID);
                break;

            case "Down":
                Cond down = new Cond(this.MyPK);
                down.DoDown(this.FK_MainNode);
                down.RetrieveFromDBSources();
                DBAccess.RunSQL("UPDATE WF_Cond SET PRI=" + down.PRI + " WHERE ToNodeID=" + down.ToNodeID);
                break;

            default:
                break;
            }

            BP.WF.Node nd = new BP.WF.Node(this.FK_MainNode);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("class='GroupTitle' colspan='7'", nd.Name);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("class='GroupTitle'", "从节点ID");
            this.Pub1.AddTD("class='GroupTitle'", "从节点名称");
            this.Pub1.AddTD("class='GroupTitle'", "到节点ID");
            this.Pub1.AddTD("class='GroupTitle'", "到节点名称");
            this.Pub1.AddTD("class='GroupTitle'", "优先级");
            this.Pub1.AddTD("class='GroupTitle' colspan=2", "操作");
            this.Pub1.AddTREnd();

            Conds cds = new Conds();

            //BP.En.QueryObject qo = new QueryObject(cds);
            //qo.AddWhere(CondAttr.FK_Node, this.FK_MainNode);
            //qo.addAnd();
            //qo.AddWhere(CondAttr.FK_Node, this.FK_MainNode);

            cds.Retrieve(CondAttr.FK_Node, this.FK_MainNode, CondAttr.CondType, 2, CondAttr.PRI);
            string strs = "";

            foreach (Cond cd in cds)
            {
                if (strs.Contains("," + cd.ToNodeID.ToString()))
                {
                    continue;
                }

                strs += "," + cd.ToNodeID.ToString();

                BP.WF.Node mynd = new BP.WF.Node(cd.ToNodeID);

                this.Pub1.AddTR();
                this.Pub1.AddTD(nd.NodeID);
                this.Pub1.AddTD(nd.Name);
                this.Pub1.AddTD(mynd.NodeID);
                this.Pub1.AddTD(mynd.Name);
                this.Pub1.AddTD(cd.PRI);
                this.Pub1.AddTD("<a href='CondPRI.aspx?CondType=2&DoType=Up&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + this.FK_MainNode + "&ToNodeID=" + this.ToNodeID + "&MyPK=" + cd.MyPK + "' class='easyui-linkbutton' data-options=\"iconCls:'icon-up'\">上移</a>");
                this.Pub1.AddTD("<a href='CondPRI.aspx?CondType=2&DoType=Down&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + this.FK_MainNode + "&ToNodeID=" + this.ToNodeID + "&MyPK=" + cd.MyPK + "' class='easyui-linkbutton' data-options=\"iconCls:'icon-down'\">下移</a>");
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();
            this.Pub1.AddBR();

            string help = "";

            help += "<ul>";
            help += "<li>在转向中,如果出现一个以上的路线都成立时时,系统就会按照第一个路线来计算,那一个排列最前面就按照那一个计算。</li>";
            help += "<li>例如:在demo中002.请假流程,如果一个人员既有基层岗,也有中层岗那么到达基层与中层的路线都会成立,如果设置了方向条件的优先级,系统就会按照优先满足的条件的路线计算。</li>";
            help += "</ul>";

            this.Pub1.AddEasyUiPanelInfo("帮助", "<span style='font-weight:bold'>什么是方向条件的优先级?</span><br />" + Environment.NewLine
                                         + help, "icon-help");
        }
Exemple #22
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
            {
                SysEnums ses = new SysEnums("StaGrade");
                Stations sts = new Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (ses.Count == 0)
                    {
                        SysEnum se = new SysEnum();
                        se.EnumKey = "StaGrade";
                        se.Lab     = "普通岗";
                        se.IntKey  = 0;
                        se.Insert();

                        ses.AddEntity(se);
                    }

                    foreach (Station st in sts)
                    {
                        st.StaGrade = 0;
                        st.Save();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位枚举值对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                foreach (SysEnum se in ses)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = se.Lab;
                    mycb.ID   = "CB_s_d" + se.IntKey;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (Station st in sts)
                    {
                        if (st.StaGrade != se.IntKey)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                /*BPM 模式*/
                BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                tps.RetrieveAll();

                BP.GPM.Stations sts = new BP.GPM.Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (tps.Count == 0)
                    {
                        var stp = new BP.GPM.StationType {
                            No = "01", Name = "普通岗"
                        };
                        stp.Save();

                        tps.AddEntity(stp);
                    }

                    //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                    foreach (BP.GPM.Station st in sts)
                    {
                        st.FK_StationType = tps[0].No;
                        st.Update();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位外键对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                foreach (BP.GPM.StationType tp in tps)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = tp.Name;
                    mycb.ID   = "CB_s_d" + tp.No;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (BP.GPM.Station st in sts)
                    {
                        if (st.FK_StationType != tp.No)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        this.Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
Exemple #23
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            BP.WF.Cond cond = new Cond();
            cond.MyPK = this.MyPK;
            if (cond.RetrieveFromDBSources() == 0)
            {
                if (this.FK_Attr != null)
                {
                    cond.FK_Attr = this.FK_Attr;
                }
                if (this.FK_MainNode != 0)
                {
                    cond.NodeID = this.FK_MainNode;
                }
                if (this.FK_Node != 0)
                {
                    cond.FK_Node = this.FK_Node;
                }
                if (this.FK_Flow != null)
                {
                    cond.FK_Flow = this.FK_Flow;
                }
            }
            this.AddTable("border=0 widht='500px'");
            //this.AddCaptionLeft("");
            this.AddTR();
            this.AddTDTitle("项目");
            this.AddTDTitle("采集");
            this.AddTDTitle("描述");
            this.AddTREnd();

            this.AddTR();
            this.AddTD("节点");
            Nodes nds  = new Nodes(cond.FK_Flow);
            Nodes ndsN = new Nodes();

            foreach (BP.WF.Node mynd in nds)
            {
                ndsN.AddEntity(mynd);
            }
            DDL ddl = new DDL();

            ddl.ID = "DDL_Node";
            ddl.BindEntities(ndsN, "NodeID", "Name");
            ddl.SetSelectItem(cond.FK_Node);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.AddTD(ddl);
            this.AddTD("节点");
            this.AddTREnd();

            // 属性/字段
            MapAttrs attrs = new MapAttrs();

            attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + ddl.SelectedItemStringVal);

            MapAttrs attrNs = new MapAttrs();

            foreach (MapAttr attr in attrs)
            {
                if (attr.IsBigDoc)
                {
                    continue;
                }

                switch (attr.KeyOfEn)
                {
                case "Title":
                //case "RDT":
                //case "CDT":
                case "FK_Emp":
                case "MyNum":
                case "FK_NY":
                case WorkAttr.Emps:
                case WorkAttr.OID:
                case StartWorkAttr.Rec:
                case StartWorkAttr.FID:
                    continue;

                default:
                    break;
                }
                attrNs.AddEntity(attr);
            }
            ddl    = new DDL();
            ddl.ID = "DDL_Attr";
            if (attrNs.Count == 0)
            {
                BP.WF.Node nd = new BP.WF.Node(cond.FK_Node);
                nd.RepareMap();
                this.AddTR();
                this.AddTD("");
                this.AddTD("colspan=2", "节点没有找到合适的条件");
                this.AddTREnd();
                this.AddTableEnd();
                return;
            }
            else
            {
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack          = true;
                ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
                ddl.SetSelectItem(cond.FK_Attr);
            }

            this.AddTR();
            this.AddTD("属性/字段");
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();

            MapAttr attrS = new MapAttr(this.DDL_Attr.SelectedItemStringVal);

            this.AddTR();
            this.AddTD("操作符");
            ddl    = new DDL();
            ddl.ID = "DDL_Oper";
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
            case BP.En.FieldTypeS.FK:
                ddl.Items.Add(new ListItem("=", "="));
                ddl.Items.Add(new ListItem("<>", "<>"));
                break;

            case BP.En.FieldTypeS.Normal:
                switch (attrS.MyDataType)
                {
                case BP.DA.DataType.AppString:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppDateTime:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem("LIKE", "LIKE"));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;

                case BP.DA.DataType.AppBoolean:
                    ddl.Items.Add(new ListItem("=", "="));
                    break;

                default:
                    ddl.Items.Add(new ListItem("=", "="));
                    ddl.Items.Add(new ListItem(">", ">"));
                    ddl.Items.Add(new ListItem(">=", ">="));
                    ddl.Items.Add(new ListItem("<", "<"));
                    ddl.Items.Add(new ListItem("<=", "<="));
                    ddl.Items.Add(new ListItem("<>", "<>"));
                    break;
                }
                break;

            default:
                break;
            }

            if (cond != null)
            {
                try
                {
                    ddl.SetSelectItem(cond.OperatorValueInt);
                }
                catch
                {
                }
            }
            this.AddTD(ddl);
            this.AddTD("");
            this.AddTREnd();
            switch (attrS.LGType)
            {
            case BP.En.FieldTypeS.Enum:
                this.AddTR();
                this.AddTD("值");
                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindSysEnum(attrS.UIBindKey);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueInt);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            case BP.En.FieldTypeS.FK:
                this.AddTR();
                this.AddTD("值");

                ddl    = new DDL();
                ddl.ID = "DDL_Val";
                ddl.BindEntities(attrS.HisEntitiesNoName);
                if (cond != null)
                {
                    try
                    {
                        ddl.SetSelectItem(cond.OperatorValueStr);
                    }
                    catch
                    {
                    }
                }
                this.AddTD(ddl);
                this.AddTD("");
                this.AddTREnd();
                break;

            default:
                if (attrS.MyDataType == BP.DA.DataType.AppBoolean)
                {
                    this.AddTR();
                    this.AddTD("值");
                    ddl    = new DDL();
                    ddl.ID = "DDL_Val";
                    ddl.BindAppYesOrNo(0);
                    if (cond != null)
                    {
                        try
                        {
                            ddl.SetSelectItem(cond.OperatorValueInt);
                        }
                        catch
                        {
                        }
                    }
                    this.AddTD(ddl);
                    this.AddTD();
                    this.AddTREnd();
                }
                else
                {
                    this.AddTR();
                    this.AddTD("值");
                    TB tb = new TB();
                    tb.ID = "TB_Val";
                    if (cond != null)
                    {
                        tb.Text = cond.OperatorValueStr;
                    }
                    this.AddTD(tb);
                    this.AddTD();
                    this.AddTREnd();
                }
                break;
            }


            Conds       conds = new Conds();
            QueryObject qo    = new QueryObject(conds);

            qo.AddWhere(CondAttr.NodeID, this.FK_MainNode);
            qo.addAnd();
            qo.AddWhere(CondAttr.DataFrom, (int)ConnDataFrom.Form);
            qo.addAnd();
            qo.AddWhere(CondAttr.CondType, (int)this.HisCondType);

            if (this.ToNodeID != 0)
            {
                qo.addAnd();
                qo.AddWhere(CondAttr.ToNodeID, this.ToNodeID);
            }
            int num = qo.DoQuery();


            this.AddTRSum();
            this.Add("<TD class=TD colspan=3 align=center>");
            Button btn = new Button();

            btn.ID       = "Btn_Save";
            btn.CssClass = "Btn";
            btn.Text     = " Save ";

            btn.Click += new EventHandler(btn_Save_Click);
            this.Add(btn);

            btn          = new Button();
            btn.ID       = "Btn_Del";
            btn.CssClass = "Btn";
            btn.Text     = "Clear";
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);

            this.Add(btn);

            this.Add("</TD>");
            this.AddTREnd();

            this.AddTableEnd();

            if (num == 0)
            {
                return;
            }


            #region 条件
            this.AddTable("border=0 widht='500px'");
            this.AddCaptionLeft("说明:同时满足如下条件转向成立,只能删除不能编辑.");
            this.AddTR();
            this.AddTDTitle("IDX");
            this.AddTDTitle("节点");
            this.AddTDTitle("字段的英文名");
            this.AddTDTitle("字段的中文名");
            this.AddTDTitle("操作符");
            this.AddTDTitle("值");
            this.AddTDTitle("标签");
            this.AddTDTitle("操作");
            this.AddTREnd();

            int i = 0;
            foreach (Cond mync in conds)
            {
                if (mync.HisDataFrom != ConnDataFrom.Form)
                {
                    continue;
                }

                i++;

                this.AddTR();
                this.AddTDIdx(i);
                //  this.AddTD(mync.HisDataFrom.ToString());
                this.AddTD(mync.FK_NodeT);
                this.AddTD(mync.AttrKey);
                this.AddTD(mync.AttrName);

                this.AddTDCenter(mync.FK_Operator);
                this.AddTD(mync.OperatorValueStr);
                this.AddTD(mync.OperatorValueT);
                //if (num > 1)
                //    this.AddTD(mync.HisConnJudgeWayT);
                this.AddTD("<a href='Cond.aspx?MyPK=" + mync.MyPK + "&CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_Attr=" + mync.FK_Attr + "&FK_MainNode=" + mync.NodeID + "&OperatorValue=" + mync.OperatorValueStr + "&FK_Node=" + mync.FK_Node + "&DoType=Del&ToNodeID=" + mync.ToNodeID + "' >删除</a>");
                this.AddTREnd();
            }
            this.AddTableEnd();
            #endregion
        }
Exemple #24
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            /*BPM 模式*/
            BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
            tps.RetrieveAll();

            BP.GPM.Stations sts = new BP.GPM.Stations();
            sts.RetrieveAll();

            string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
            DataTable dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count != 0)
            {
                if (tps.Count == 0)
                {
                    var stp = new BP.GPM.StationType {
                        No = "01", Name = "普通岗"
                    };
                    stp.Save();
                    tps.AddEntity(stp);
                }

                //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                foreach (BP.GPM.Station st in sts)
                {
                    st.FK_StationType = tps[0].No;
                    st.Update();
                }
            }

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            foreach (BP.GPM.StationType tp in tps)
            {
                this.Pub1.AddTR();
                CheckBox mycb = new CheckBox();
                mycb.Text = tp.Name;
                mycb.ID   = "CB_s_d" + tp.No;
                this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                this.Pub1.AddTREnd();

                int    i      = 0;
                string ctlIDs = "";

                foreach (BP.GPM.Station st in sts)
                {
                    if (st.FK_StationType != tp.No)
                    {
                        continue;
                    }

                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    CheckBox cb = new CheckBox();
                    cb.ID   = "CB_" + st.No;
                    ctlIDs += cb.ID + ",";
                    cb.Text = st.Name;
                    if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            #region //增加“指定的操作员”选项,added by liuxc,2015-10-7
            var ddl = new DDL();
            ddl.ID    = "DDL_" + CondAttr.SpecOperWay;
            ddl.Width = 200;
            ddl.Items.Add(new ListItem("当前操作员", "0"));
            ddl.Items.Add(new ListItem("指定节点的操作员", "1"));
            ddl.Items.Add(new ListItem("指定表单字段作为操作员", "2"));
            ddl.Items.Add(new ListItem("指定操作员编号", "3"));
            ddl.SetSelectItem((int)cond.SpecOperWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            Pub1.Add("指定的操作员:");
            Pub1.Add(ddl);
            Pub1.AddBR();
            Pub1.AddBR();

            var lbl = new Label();
            lbl.ID = "LBL1";

            switch (cond.SpecOperWay)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            Pub1.Add(lbl);

            var tb = new TB();
            tb.ID      = "TB_" + CondAttr.SpecOperPara;
            tb.Width   = 200;
            tb.Text    = cond.SpecOperPara;
            tb.Enabled = cond.SpecOperWay != SpecOperWay.CurrOper;
            Pub1.Add(tb);
            Pub1.AddSpace(1);
            Pub1.Add("多个值请用英文“逗号”来分隔。");
            Pub1.AddBR();
            Pub1.AddBR();
            #endregion

            Pub1.AddSpace(1);
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
Exemple #25
0
        public string CondStation_Save()
        {
            int      FK_MainNode = this.GetRequestValInt("FK_MainNode");
            int      ToNodeID    = this.GetRequestValInt("ToNodeID");
            CondType HisCondType = CondType.Dir;

            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, FK_MainNode,
                        CondAttr.ToNodeID, ToNodeID,
                        CondAttr.CondType, (int)HisCondType);

            string mypk = FK_MainNode + "_" + ToNodeID + "_Dir_" + ConnDataFrom.Stas.ToString();

            // 删除岗位条件.
            cond.MyPK = mypk;
            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Stas;
                cond.NodeID      = FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = ToNodeID;
                cond.Insert();
            }

            string   val = "";
            Stations sts = new Stations();

            sts.RetrieveAllFromDBSource();
            foreach (Station st in sts)
            {
                if (this.GetRequestVal("CB_" + st.No) != "1")
                {
                    continue;
                }
                val += "@" + st.No;
            }

            val += "@";
            cond.OperatorValue = val;
            cond.HisDataFrom   = ConnDataFrom.Stas;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = CondType.Dir;
            cond.FK_Node       = FK_MainNode;

            #region //获取“指定的操作员”设置,added by liuxc,2015-10-7
            cond.SpecOperWay = (SpecOperWay)this.GetRequestValInt("DDL_" + CondAttr.SpecOperWay);

            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = this.GetRequestVal("TB_" + CondAttr.SpecOperPara);
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            #endregion

            cond.ToNodeID = ToNodeID;
            cond.Update();

            return("保存成功..");
        }