Beispiel #1
0
        void btn_Click(object sender, EventArgs e)
        {
            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Delete)
            {
                #region songhonggang (2014-06-15) 修改点击删除的时候删除条件
                Cond deleteCond = new Cond();
                deleteCond.Delete(CondAttr.NodeID, this.FK_MainNode,
                                  CondAttr.ToNodeID, this.ToNodeID,
                                  CondAttr.CondType, (int)this.HisCondType);
                #endregion
                this.Response.Redirect(this.Request.RawUrl, true);

                return;
            }

            string sql = this.GetTextBoxByID("TB_SQL").Text;

            if (string.IsNullOrEmpty(sql))
            {
                this.Alert("请填写sql语句.");
                return;
            }

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

            cond.MyPK          = this.GenerMyPK;
            cond.HisDataFrom   = ConnDataFrom.SQL;
            cond.NodeID        = this.FK_MainNode;
            cond.FK_Node       = this.FK_MainNode;
            cond.FK_Flow       = this.FK_Flow;
            cond.ToNodeID      = this.ToNodeID;
            cond.OperatorValue = sql;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;

            cond.Insert();

            EasyUiHelper.AddEasyUiMessager(this, "保存成功!");

            //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("未设计的情况。");
            //}
        }
Beispiel #2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public string CondBySQL_Save()
        {
            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();

            string sql = this.GetRequestVal("TB_Docs");

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

            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, fk_mainNode,
                        CondAttr.ToNodeID, toNodeID,
                        CondAttr.CondType, (int)condTypeEnum);

            cond.MyPK        = mypk;
            cond.HisDataFrom = ConnDataFrom.SQL;

            cond.NodeID   = this.GetRequestValInt("FK_MainNode");
            cond.FK_Node  = this.GetRequestValInt("FK_MainNode");
            cond.ToNodeID = this.GetRequestValInt("ToNodeID");

            cond.FK_Flow       = this.FK_Flow;
            cond.OperatorValue = sql;
            cond.Note          = this.GetRequestVal("TB_Note"); //备注.

            cond.FK_Flow     = this.FK_Flow;
            cond.HisCondType = condTypeEnum;
            cond.Insert();

            return("保存成功..");
        }
Beispiel #3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public string CondBySQLTemplate_Save()
        {
            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.SQLTemplate.ToString();

            string sql = this.GetRequestVal("TB_Docs");

            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, fk_mainNode,
                        CondAttr.ToNodeID, toNodeID,
                        CondAttr.CondType, (int)condTypeEnum);

            cond.MyPK        = mypk;
            cond.HisDataFrom = ConnDataFrom.SQLTemplate;

            cond.NodeID   = this.GetRequestValInt("FK_MainNode");
            cond.FK_Node  = this.GetRequestValInt("FK_MainNode");
            cond.ToNodeID = this.GetRequestValInt("ToNodeID");

            cond.FK_Flow       = this.FK_Flow;
            cond.OperatorValue = sql;
            cond.Note          = this.GetRequestVal("TB_Note"); //备注.

            cond.FK_Flow     = this.FK_Flow;
            cond.HisCondType = condTypeEnum;
            cond.Insert();

            return("保存成功..");
        }
Beispiel #4
0
        void btn_Click(object sender, EventArgs e)
        {
            string exp = this.GetTextBoxByID("TB_Para").Text;

            if (string.IsNullOrEmpty(exp))
            {
                this.Alert("请按格式填写表达式.");
                return;
            }

            exp = exp.Trim();
            string[] strs = exp.Split(' ');
            if (strs.Length != 3)
            {
                this.Alert("表达式格式错误,请参考格式要求");
                return;
            }

            Cond cond = new Cond();

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

            Button btn = sender as Button;

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

            cond.MyPK          = this.GenerMyPK;
            cond.HisDataFrom   = ConnDataFrom.Paras;
            cond.NodeID        = this.FK_MainNode;
            cond.FK_Node       = this.FK_MainNode;
            cond.FK_Flow       = this.FK_Flow;
            cond.ToNodeID      = this.ToNodeID;
            cond.OperatorValue = exp;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_Node;
            cond.Insert();
            this.Alert("保存成功");

            //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("未设计的情况。");
            //}
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Page.Title = "部门条件";
     if (this.Request.QueryString["DoType"] == "Del")
     {
         Cond nd = new Cond(this.MyPK);
         nd.Delete();
         this.Response.Redirect("CondDept.aspx?CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + nd.NodeID + "&FK_Node=" + this.FK_MainNode + "&ToNodeID=" + nd.ToNodeID, true);
         return;
     }
     this.BindCond();
 }
Beispiel #6
0
        /// <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("保存成功..");
        }
Beispiel #7
0
        void btn_Click(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.Delete(CondAttr.ToNodeID, this.ToNodeID, CondAttr.DataFrom, (int)ConnDataFrom.SQL);
            Button btn = sender as Button;

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

            string sql = this.GetTextBoxByID("TB_SQL").Text;

            if (string.IsNullOrEmpty(sql))
            {
                this.Alert("请填写sql语句.");
                return;
            }

            cond.MyPK        = this.GenerMyPK;
            cond.HisDataFrom = ConnDataFrom.SQL;

            cond.NodeID  = this.FK_MainNode;
            cond.FK_Node = this.FK_MainNode;

            cond.FK_Flow       = this.FK_Flow;
            cond.ToNodeID      = this.ToNodeID;
            cond.OperatorValue = sql;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;

            cond.Insert();
            this.Alert("保存成功");

            //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("未设计的情况。");
            //}
        }
Beispiel #8
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public string StandAloneFrm_Delete()
        {
            Cond deleteCond = new Cond();

            deleteCond.MyPK = this.MyPK;
            int i = deleteCond.Delete();

            if (i == 1)
            {
                return("删除成功..");
            }

            return("无可删除的数据.");
        }
Beispiel #9
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("保存成功!!");
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.QueryString["DoType"] == "Del")
            {
                Cond nd = new Cond(this.MyPK);
                nd.Delete();
                this.Response.Redirect("Cond.aspx?CondType=" + (int)this.HisCondType + "&FK_Flow=" + this.FK_Flow + "&FK_MainNode=" + nd.NodeID + "&FK_Node=" + this.FK_MainNode + "&ToNodeID=" + nd.ToNodeID, true);
                return;
            }

            this.BindCond();
            if (this.FK_Attr == null)
            {
                this.FK_Attr = this.DDL_Attr.SelectedItemStringVal;
            }
        }
Beispiel #11
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public string CondByStation_Delete()
        {
            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 deleteCond = new Cond();
            int  i          = deleteCond.Delete(CondAttr.NodeID, fk_mainNode,
                                                CondAttr.ToNodeID, toNodeID,
                                                CondAttr.CondType, (int)condTypeEnum);

            if (i == 1)
            {
                return("删除成功..");
            }

            return("无可删除的数据.");
        }
Beispiel #12
0
        void btn_Click(object sender, EventArgs e)
        {
            string exp = this.GetTextBoxByID("TB_Para").Text;

            if (string.IsNullOrEmpty(exp))
            {
                this.Alert("请按格式填写表达式.");
                return;
            }

            exp = exp.Trim();

            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;
            cond.HisDataFrom   = ConnDataFrom.Url;
            cond.NodeID        = this.FK_MainNode;
            cond.FK_Node       = this.FK_MainNode;
            cond.FK_Flow       = this.FK_Flow;
            cond.ToNodeID      = this.ToNodeID;
            cond.OperatorValue = exp;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_Node;
            cond.Insert();

            EasyUiHelper.AddEasyUiMessager(this, "保存成功!");
        }
Beispiel #13
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("未设计的情况。");
            }
        }
Beispiel #14
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("未设计的情况。");
            }
        }
Beispiel #15
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, "保存成功!");
        }
Beispiel #16
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("保存成功..");
        }