Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.QueryString["REID"] != null)
            {
                RegularExpressionDtls reDtls = new RegularExpressionDtls();
                reDtls.RetrieveAll();

                //删除现有的逻辑.
                BP.Sys.MapExts exts = new BP.Sys.MapExts();
                exts.Delete(MapExtAttr.AttrOfOper, this.KeyOfEn,
                            MapExtAttr.ExtType, BP.Sys.MapExtXmlList.RegularExpression);

                // 开始装载.
                foreach (RegularExpressionDtl dtl in reDtls)
                {
                    if (dtl.ItemNo != this.Request.QueryString["REID"])
                    {
                        continue;
                    }

                    BP.Sys.MapExt ext = new BP.Sys.MapExt();
                    ext.MyPK       = this.FK_MapData + "_" + this.KeyOfEn + "_" + MapExtXmlList.RegularExpression + "_" + dtl.ForEvent;
                    ext.FK_MapData = this.FK_MapData;
                    ext.AttrOfOper = this.KeyOfEn;
                    ext.Doc        = dtl.Exp;                         //表达公式.
                    ext.Tag        = dtl.ForEvent;                    //时间.
                    ext.Tag1       = dtl.Msg;                         //消息
                    ext.ExtType    = MapExtXmlList.RegularExpression; // 表达公式 .
                    ext.Insert();
                }
                //this.WinClose("1"); //关闭并返回一个值。
                return;
            }

            RegularExpressions res = new RegularExpressions();

            res.RetrieveAll();

            this.Pub1.AddH3("事件模版-点击名称选用它.");
            this.Pub1.AddHR();

            this.Pub1.AddUL();
            foreach (RegularExpression item in res)
            {
                this.Pub1.AddLi("<a href=\"javascript:DoIt('" + this.FK_MapData + "','" + this.KeyOfEn
                                + "','" + this.ForCtrl + "','" + item.No + "','" + item.Name
                                + "');\" >" + item.Name + "</a> - " + item.Note);
            }
            this.Pub1.AddULEnd();
        }
Exemplo n.º 2
0
        public void btn_SaveReTemplete_Click(object sender, EventArgs e)
        {
            ListBox lb = this.Pub1.FindControl("LBReTemplete") as ListBox;

            if (lb == null && lb.SelectedItem.Value == null)
            {
                return;
            }

            string newMyPk = "";
            RegularExpressionDtls reDtls = new RegularExpressionDtls();

            reDtls.RetrieveAll();

            //删除现有的逻辑.
            BP.Sys.MapExts exts = new BP.Sys.MapExts();


            string[] strs = this.RefNo.Split(',');
            foreach (string field in strs)
            {
                if (string.IsNullOrEmpty(field) == true)
                {
                    continue;
                }

                exts.Delete(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.AttrOfOper, field, MapExtAttr.ExtType, BP.Sys.MapExtXmlList.RegularExpression);
            }


            // 开始装载.
            foreach (RegularExpressionDtl dtl in reDtls)
            {
                if (dtl.ItemNo != lb.SelectedItem.Value)
                {
                    continue;
                }

                foreach (string field in strs)
                {
                    if (string.IsNullOrEmpty(field) == true)
                    {
                        continue;
                    }

                    BP.Sys.MapExt ext = new BP.Sys.MapExt();
                    ext.MyPK       = this.FK_MapData + "_" + field + "_" + MapExtXmlList.RegularExpression + "_" + dtl.ForEvent;
                    ext.FK_MapData = this.FK_MapData;
                    ext.AttrOfOper = field;
                    ext.Doc        = dtl.Exp;                         //表达公式.
                    ext.Tag        = dtl.ForEvent;                    //时间.
                    ext.Tag1       = dtl.Msg;                         //消息
                    ext.ExtType    = MapExtXmlList.RegularExpression; // 表达公式 .
                    ext.Insert();
                    newMyPk = ext.MyPK;
                }
            }

            if (this.RefNo != null && this.RefNo.Contains(","))
            {
                this.WinCloseWithMsg("已经保存成功.");
                return;
            }
            else
            {
                this.Response.Redirect("RegularExpression.aspx?FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "&ExtType=" + this.ExtType + "&MyPK=" + newMyPk + "&OperAttrKey=" + this.OperAttrKey + "&DoType=New", true);
            }
        }