Esempio n. 1
0
        protected void Btn_Save_Click(object sender, EventArgs e)
        {
            BP.Sys.MapExt me = new MapExt();
            if (this.MyPK != null)
            {
                me.MyPK = this.MyPK;
                me.RetrieveFromDBSources();

                me.FK_MapData = this.FK_MapData;
                me.Doc        = this.Fields;
                me.ExtType    = "Sepc" + this.DoType + "SepcUsers";
                me.Tag        = this.FK_Node;
                me.Tag1       = this.TB_Emps.Text;
                me.Update();
            }
            else
            {
                me.MyPK = BP.DA.DBAccess.GenerGUID();

                me.FK_MapData = this.FK_MapData;
                me.Doc        = this.Fields;
                me.Tag        = this.FK_Node;
                me.Tag1       = this.TB_Emps.Text;
                me.ExtType    = "Sepc" + this.DoType + "SepcUsers";
                me.Insert();
            }

            this.WinClose("设置成功.");
        }
Esempio n. 2
0
        public void BindRegularExpressionEdit_ClickSave(string myEvent)
        {
            string[] fields = this.RefNo.Split(',');
            foreach (string filed in fields)
            {
                if (string.IsNullOrEmpty(filed))
                {
                    continue;
                }

                MapExt me = new MapExt();
                me.FK_MapData = this.FK_MapData;
                me.ExtType    = this.ExtType;
                me.Tag        = myEvent;
                me.AttrOfOper = filed;
                me.MyPK       = this.FK_MapData + "_" + filed + "_" + me.ExtType + "_" + me.Tag;
                me.Delete();

                me.Doc  = this.Pub1.GetTextBoxByID("TB_Doc_" + myEvent).Text;
                me.Tag1 = this.Pub1.GetTextBoxByID("TB_Tag1_" + myEvent).Text;
                if (me.Doc.Trim().Length == 0)
                {
                    return;
                }
                me.Insert();
            }
        }
Esempio n. 3
0
        static Map loadAsciiMap(string path)
        {
            string asciiMap = File.ReadAllText(path);
            var    width    = asciiMap.IndexOf(Environment.NewLine, 0);
            var    height   = lineCount(asciiMap);

            return(MapExt.fromString(asciiMap, width, height));
Esempio n. 4
0
        /// <summary>
        /// 保存它
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btn_SavePageLoadFull_Click(object sender, EventArgs e)
        {
            MapExt me = new MapExt();

            me.MyPK       = this.FK_MapData + "_" + MapExtXmlList.PageLoadFull;
            me.FK_MapData = this.FK_MapData;
            me.ExtType    = MapExtXmlList.PageLoadFull;
            me.RetrieveFromDBSources();

            me.Tag = this.Pub1.GetTextBoxByID("TB_" + MapExtAttr.Tag).Text;
            string  sql  = "";
            MapDtls dtls = new MapDtls(this.FK_MapData);

            foreach (MapDtl dtl in dtls)
            {
                sql += "*" + dtl.No + "=" + this.Pub1.GetTextBoxByID("TB_" + dtl.No).Text;
            }
            me.Tag1 = sql;

            me.MyPK = this.FK_MapData + "_" + MapExtXmlList.PageLoadFull;

            string info = me.Tag1 + me.Tag;

            if (string.IsNullOrEmpty(info))
            {
                me.Delete();
            }
            else
            {
                me.Save();
            }
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = this.Lab;

            switch (this.DoType)
            {
            case "Del":
                MapExt mm = new MapExt();
                mm.MyPK = this.MyPK;
                mm.Retrieve();
                mm.Delete();
                this.Response.Redirect("InputCheck.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&RefNo=" + this.RefNo, true);
                return;

            default:
                break;
            }

            if (this.MyPK != null || this.DoType == "New")
            {
                Edit_InputCheck();
                return;
            }

            MapExts mes = new MapExts();

            mes.Retrieve(MapExtAttr.ExtType, this.ExtType,
                         MapExtAttr.FK_MapData, this.FK_MapData);
            this.MapJS(mes);
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                MapAttr mattrNew = new MapAttr(this.RefNo);

                MapExt me = new MapExt();
                me.MyPK = this.RefNo + "_AutoFull";
                me.RetrieveFromDBSources();
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = mattrNew.KeyOfEn;
                me.ExtType    = MapExtXmlList.AutoFull;
                if (me.Tag == "0")
                {
                    this.RB_0.Checked = true;
                    this.TB_Exp.Text  = "";
                }
                else
                {
                    this.RB_0.Checked = false;
                }

                if (me.Tag == "1")
                {
                    this.RB_1.Checked = true;
                }
                else
                {
                    this.RB_1.Checked = false;
                }

                this.TB_Exp.Text = me.Doc;
            }
        }
Esempio n. 7
0
 protected void Btn_Del_Click(object sender, EventArgs e)
 {
     BP.Sys.MapExt me = new MapExt();
     me.MyPK = this.MyPK;
     me.Delete();
     this.WinClose("删除成功.");
 }
Esempio n. 8
0
 /// <summary>
 /// 生成列的计算
 /// </summary>
 /// <param name="pk"></param>
 /// <param name="attrs"></param>
 /// <param name="attr"></param>
 /// <returns></returns>
 public string GenerAutoFull(string pk, MapAttrs attrs, MapExt ext)
 {
     try
     {
         string left  = "\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value = ";
         string right = ext.Doc;
         foreach (MapAttr mattr in attrs)
         {
             string  tbID = "TB_" + mattr.KeyOfEn + "_" + pk;
             TextBox tb   = this.Pub1.GetTextBoxByID(tbID);
             if (tb == null)
             {
                 continue;
             }
             right = right.Replace("@" + mattr.Name, " parseFloat( document.forms[0]." + this.Pub1.GetTextBoxByID(tbID).ClientID + ".value.replace( ',' ,  '' ) ) ");
             right = right.Replace("@" + mattr.KeyOfEn, " parseFloat( document.forms[0]." + this.Pub1.GetTextBoxByID(tbID).ClientID + ".value.replace( ',' ,  '' ) ) ");
         }
         string s = left + right;
         s += "\t\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value= VirtyMoney(document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value ) ;";
         return(s += " C" + ext.AttrOfOper + "();");
     }
     catch (Exception ex)
     {
         this.Alert(ex.Message);
         return("");
     }
 }
Esempio n. 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack == false)
     {
         MapExt   myme  = new MapExt(this.MyPK);
         MapAttrs attrs = new MapAttrs(myme.FK_MapData);
         string[] strs  = myme.Tag.Split('$');
         foreach (MapAttr attr in attrs)
         {
             if (attr.LGType == FieldTypeS.Normal)
             {
                 continue;
             }
             if (attr.UIIsEnable == false)
             {
                 continue;
             }
             foreach (string s in strs)
             {
                 if (s == null)
                 {
                     continue;
                 }
                 if (s.Contains(attr.KeyOfEn + ":") == false)
                 {
                     continue;
                 }
                 string[] ss = s.Split(':');
                 this.TB_SQL.Text = ss[1];                               //填充文本
             }
             this.LabJLZD.Text = attr.Name + " " + attr.KeyOfEn + " 字段"; //填充lab控件
         }
     }
 }
Esempio n. 10
0
        public string TBFullCtrlDtl_Save()
        {
            MapDtls dtls = new MapDtls(this.FK_MapData);
            MapExt  me   = new MapExt(this.MyPK);

            string str = "";

            foreach (MapDtl dtl in dtls)
            {
                string sql = this.GetRequestVal("TB_" + dtl.No);
                sql = sql.Trim();
                if (sql == "" || sql == null)
                {
                    continue;
                }

                if (sql.Contains("@Key") == false)
                {
                    return("err@在配置从表:" + dtl.No + " sql填写错误, 必须包含@Key列, @Key就是当前文本框输入的值. ");
                }

                str += "$" + dtl.No + ":" + sql;
            }
            me.Tag1 = str;
            me.Update();

            return("保存成功.");
        }
Esempio n. 11
0
        public string ActiveDDL_Init()
        {
            DataSet ds = new DataSet();

            //加载外键字段.
            Paras ps = new Paras();

            ps.SQL = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData=" + SystemConfig.AppCenterDBVarStr + "FK_MapData AND KeyOfEn!=" + SystemConfig.AppCenterDBVarStr + "KeyOfEn";
            ps.Add("FK_MapData", this.FK_MapData);
            ps.Add("KeyOfEn", this.KeyOfEn);
            //var sql = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData='" + this.FK_MapData + "' AND KeyOfEn!='" + this.KeyOfEn + "'";
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps);

            dt.TableName = "Sys_MapAttr";

            dt.Columns[0].ColumnName = "No";
            dt.Columns[1].ColumnName = "Name";
            ds.Tables.Add(dt);

            if (dt.Rows.Count == 0)
            {
                return("err@表单中没有要级联的下拉框.");
            }

            //加载数据源.
            SFDBSrcs srcs = new SFDBSrcs();

            srcs.RetrieveAll();
            DataTable dtSrc = srcs.ToDataTableField();

            dtSrc.TableName = "Sys_SFDBSrc";
            ds.Tables.Add(dtSrc);

            // 加载mapext 数据.
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            if (i == 0)
            {
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = "local";
            }

            if (me.FK_DBSrc == "")
            {
                me.FK_DBSrc = "local";
            }

            //去掉 ' 号.
            me.SetValByKey("Doc", me.Doc);

            dt           = me.ToDataTableField();
            dt.TableName = "Sys_MapExt";
            ds.Tables.Add(dt);

            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 12
0
        public string AutoFull_Init()
        {
            DataSet ds = new DataSet();

            // 加载mapext 数据.
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.AutoFull,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            if (i == 0)
            {
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = "local";
            }

            if (me.FK_DBSrc == "")
            {
                me.FK_DBSrc = "local";
            }

            //去掉 ' 号.
            me.SetValByKey("Doc", me.Doc);

            DataTable dt = me.ToDataTableField();

            dt.TableName = "Sys_MapExt";
            ds.Tables.Add(dt);

            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 13
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public string TBFullCtrl_Save()
        {
            try
            {
                MapExt me = new MapExt();
                int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.TBFullCtrl,
                                        MapExtAttr.FK_MapData, this.FK_MapData,
                                        MapExtAttr.AttrOfOper, this.KeyOfEn);

                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = this.GetValFromFrmByKey("FK_DBSrc");
                me.Doc        = this.GetValFromFrmByKey("TB_Doc"); //要执行的SQL.

                me.ExtType = MapExtXmlList.TBFullCtrl;

                //执行保存.
                me.InitPK();

                if (me.Update() == 0)
                {
                    me.Insert();
                }

                return("保存成功.");
            }
            catch (Exception ex)
            {
                return("err@" + ex.Message);
            }
        }
    void btn_Click(object sender, EventArgs e)
    {
        MapExt ext = new MapExt(this.FK_MapExt);
        string sql = ext.TagOfSQL_autoFullTB;

        if (this.Val != null)
        {
            sql = sql.Replace("@Key", this.Val);
        }

        sql = sql.Replace("$", "");

        string    val = "";
        DataTable dt  = DBAccess.RunSQLReturnTable(sql);

        foreach (DataRow dr in dt.Rows)
        {
            RadioButton rb = this.GetRadioButtonByID("RB_" + dr["No"]);
            if (rb.Checked)
            {
                val = dr["No"].ToString();
                this.WinClose(val);
                return;
            }
        }
        this.WinClose(val);
    }
Esempio n. 15
0
        /// <summary>
        /// 生成列的计算
        /// </summary>
        /// <param name="pk"></param>
        /// <param name="attrs"></param>
        /// <param name="attr"></param>
        /// <returns></returns>
        public string GenerAutoFull(string pk, MapAttrs attrs, MapExt ext)
        {
            string left  = "\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value = ";
            string right = ext.Doc;

            foreach (MapAttr mattr in attrs)
            {
                //if (mattr.IsNum == false)
                //    continue;
                //if (mattr.LGType != FieldTypeS.Normal)
                //    continue;

                string  tbID = "TB_" + mattr.KeyOfEn + "_" + pk;
                TextBox tb   = this.Pub1.GetTextBoxByID(tbID);
                if (tb == null)
                {
                    continue;
                }

                right = right.Replace("@" + mattr.Name, " parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) ) ");
                right = right.Replace("@" + mattr.KeyOfEn, " parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) ) ");
            }
            string s = left + right;

            s += "\t\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value= VirtyMoney(document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + ext.AttrOfOper + "_" + pk).ClientID + ".value ) ;";
            return(s += " C" + ext.AttrOfOper + "();");
        }
Esempio n. 16
0
        protected void Btn_Save_Click(object sender, EventArgs e)
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapDtls dtls = new MapDtls(myme.FK_MapData);


            string info  = "";
            string error = "";

            foreach (MapDtl dtl in dtls)
            {
                if (this.TB_SQL.Text.Trim() == "")
                {
                    continue;
                }

                info += "$" + dtl.No + ":" + this.TB_SQL.Text;
            }

            if (error != "")
            {
                throw new Exception("设置错误,请更正:<br/>" + error + "");
            }
            myme.Tag1 = info;
            myme.Update();
        }
        public string AutoFullDtlField_Init()
        {
            DataSet ds = new DataSet();

            // 加载mapext 数据.
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.AutoFullDtlField,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            if (i == 0)
            {
                me.FK_MapData = this.FK_MapData;
                me.AttrOfOper = this.KeyOfEn;
                me.FK_DBSrc   = "local";
            }

            if (me.FK_DBSrc == "")
            {
                me.FK_DBSrc = "local";
            }

            //去掉 ' 号.
            me.SetValByKey("Doc", me.Doc);

            DataTable dt = me.ToDataTableField();

            dt.TableName = "Sys_MapExt";
            ds.Tables.Add(dt);

            //把从表放入里面.
            MapDtls dtls = new MapDtls(this.FK_MapData);

            ds.Tables.Add(dtls.ToDataTableField("Dtls"));

            //把从表的字段放入.
            foreach (MapDtl dtl in dtls)
            {
                string sql = "SELECT KeyOfEn as \"No\",Name as \"Name\" FROM Sys_MapAttr WHERE FK_MapData='" + dtl.No + "' AND (MyDataType=2 OR MyDataType=3 OR MyDataType=5 OR MyDataType=8)  ";
                sql += " AND KeyOfEn !='OID' AND KeyOfEn!='FID' AND KeyOfEn!='RefPK' ";

                //把从表增加里面去.
                DataTable mydt = DBAccess.RunSQLReturnTable(sql);
                mydt.TableName = dtl.No;
                ds.Tables.Add(mydt);
            }

            //把主表的字段放入
            string mainsql = "SELECT KeyOfEn as \"No\",Name as \"Name\" FROM Sys_MapAttr WHERE FK_MapData='" + this.FK_MapData + "' AND MyDataType=1 AND UIIsEnable = 0 ";

            mainsql += " AND KeyOfEn !='OID' AND KeyOfEn!='FID' AND KeyOfEn!='WorkID' AND KeyOfEn!='NodeID' AND KeyOfEn!='RefPK'  AND KeyOfEn!='RDT' AND KeyOfEn!='Rec' ";

            //把从表增加里面去.
            DataTable maindt = DBAccess.RunSQLReturnTable(mainsql);

            maindt.TableName = "main_Attr";
            ds.Tables.Add(maindt);

            return(BP.Tools.Json.ToJson(ds));
        }
Esempio n. 18
0
        public string TBFullCtrlDDL_Save()
        {
            MapExt myme = new MapExt(this.MyPK);

            MapAttrs attrs = new MapAttrs(myme.FK_MapData);

            attrs.Retrieve(MapAttrAttr.FK_MapData, myme.FK_MapData,
                           MapAttrAttr.UIIsEnable, 1, MapAttrAttr.UIContralType, (int)UIContralType.DDL);

            MapExt me = new MapExt(this.MyPK);

            string str = "";

            foreach (MapAttr attr in attrs)
            {
                string sql = this.GetRequestVal("TB_" + attr.KeyOfEn);
                sql = sql.Trim();
                if (sql == "" || sql == null)
                {
                    continue;
                }

                if (sql.Contains("@Key") == false)
                {
                    return("err@在配置从表:" + attr.KeyOfEn + " sql填写错误, 必须包含@Key列, @Key就是当前文本框输入的值. ");
                }

                str += "$" + attr.KeyOfEn + ":" + sql;
            }
            me.Tag = str;
            me.Update();

            return("保存成功.");
        }
Esempio n. 19
0
        public string TBFullCtrlDDL_Init()
        {
            MapExt   myme  = new MapExt(this.MyPK);
            MapAttrs attrs = new MapAttrs(myme.FK_MapData);

            attrs.Retrieve(MapAttrAttr.FK_MapData, myme.FK_MapData,
                           MapAttrAttr.UIIsEnable, 1, MapAttrAttr.UIContralType, (int)UIContralType.DDL);

            string[] strs = myme.Tag.Split('$');
            foreach (MapAttr attr in attrs)
            {
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }
                    if (s.Contains(attr.KeyOfEn + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    attr.DefVal = ss[1]; //使用这个字段作为对应设置的sql.
                }
            }

            return(attrs.ToJson());
        }
Esempio n. 20
0
        void mybtn_SaveAutoFullM2M_Click(object sender, EventArgs e)
        {
            //Button btn = sender as Button;
            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Cancel)
            {
                this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
                return;
            }

            MapExt  myme  = new MapExt(this.MyPK);
            MapM2Ms m2ms  = new MapM2Ms(myme.FK_MapData);
            string  info  = "";
            string  error = "";

            foreach (MapM2M m2m in m2ms)
            {
                TextBox tb = this.Pub1.GetTextBoxByID("TB_" + m2m.NoOfObj);
                if (tb.Text.Trim() == "")
                {
                    continue;
                }
                try
                {
                    DataTable dt  = BP.DA.DBAccess.RunSQLReturnTable(tb.Text);
                    string    err = "";
                    if (dt.Columns[0].ColumnName != "No")
                    {
                        err += "第1列不是No.";
                    }
                    if (dt.Columns[1].ColumnName != "Name")
                    {
                        err += "第2列不是Name.";
                    }

                    if (err != "")
                    {
                        error += "在为(" + m2m.Name + ")检查sql设置时出现错误:请确认列的顺序是否正确为大小写是否匹配。" + err;
                    }
                }
                catch (Exception ex)
                {
                    this.Alert("SQL ERROR: " + ex.Message);
                    return;
                }
                info += "$" + m2m.NoOfObj + ":" + tb.Text;
            }

            if (error != "")
            {
                this.Pub1.AddEasyUiPanelInfo("错误", "设置错误,请更正:<br />" + error, "icon-no");
                //this.Pub1.AddMsgOfWarning("设置错误,请更正:", error);
                return;
            }
            myme.Tag2 = info;
            myme.Update();
            this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
        }
Esempio n. 21
0
        void mybtn_SaveAutoFullJilian_Click(object sender, EventArgs e)
        {
            var btn = sender as LinkBtn;

            if (btn != null && btn.ID == NamesOfBtn.Cancel)
            {
                this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
                return;
            }

            string mypk = this.ExtType + "_" + this.FK_MapData + "_" + this.RefNo;


            MapExt   myme  = new MapExt(mypk);
            MapAttrs attrs = new MapAttrs(myme.FK_MapData);
            string   info  = "";

            foreach (MapAttr attr in attrs)
            {
                if (attr.LGType == FieldTypeS.Normal)
                {
                    continue;
                }

                if (attr.UIIsEnable == false)
                {
                    continue;
                }

                TextBox tb = this.Pub1.GetTextBoxByID("TB_" + attr.KeyOfEn);
                if (tb.Text.Trim() == "")
                {
                    continue;
                }

                try
                {
                    DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(tb.Text);
                    if (tb.Text.Contains("@Key") == false)
                    {
                        throw new Exception("缺少@Key参数。");
                    }

                    if (dt.Columns.Contains("No") == false || dt.Columns.Contains("Name") == false)
                    {
                        throw new Exception("在您的sql表单公式中必须有No,Name两个列,来绑定下拉框。");
                    }
                }
                catch (Exception ex)
                {
                    this.Alert("SQL ERROR: " + ex.Message);
                    return;
                }
                info += "$" + attr.KeyOfEn + ":" + tb.Text;
            }
            myme.Tag = info;
            myme.Update();
            this.Alert("保存成功.");
        }
Esempio n. 22
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            if (btn.ID == "Cancel")
            {
                this.WinClose();
                return;
            }

            MapExt me = new MapExt(this.FK_MapExt);

            int    popValFormat = me.PopValFormat;
            string val          = "";

            foreach (Control ctl in this.Pub1.Controls)
            {
                CheckBox cb = ctl as CheckBox;
                if (cb == null)
                {
                    continue;
                }
                if (cb.ID.Contains("CBs_"))
                {
                    continue;
                }
                if (cb.Checked == false)
                {
                    continue;
                }
                string text = cb.Text.Replace("<font color=green>", "");
                text = cb.Text.Replace("</font>", "");
                switch (popValFormat)
                {
                case 0:      //仅仅编号
                    val += "," + cb.ID.Replace("CB_", "");
                    break;

                case 1:     // 仅名称
                    val += "," + text;
                    break;

                case 2:     // 编号与名称
                    val += "," + cb.ID.Replace("CB_", "") + "," + text;
                    break;

                default:
                    break;
                }
            }
            val = val.Replace("<font color=green>", "");
            val = val.Replace("</font>", "");

            if (val.Length > 2)
            {
                val = val.Substring(1);
            }
            this.WinClose(val);
        }
Esempio n. 23
0
        protected void Btn_OK_Click(object sender, EventArgs e)
        {
            me      = new MapExt();
            me.MyPK = this.FK_MapExt;

            if (me.RetrieveFromDBSources() == 0)
            {
                BP.Web.Controls.FrmPopVal pv = new BP.Web.Controls.FrmPopVal(this.FK_MapExt);
                me.Copy(pv);
            }

            int    popValFormat = me.PopValFormat;
            string val          = "";

            foreach (Control ctl in this.Pub1.Controls)
            {
                CheckBox cb = ctl as CheckBox;
                if (cb == null)
                {
                    continue;
                }
                if (cb.ID.Contains("CBs_"))
                {
                    continue;
                }
                if (cb.Checked == false)
                {
                    continue;
                }
                string text = cb.Text.Replace("<font color=green>", "");
                text = cb.Text.Replace("</font>", "");
                switch (popValFormat)
                {
                case 0:      //仅仅编号
                    val += "," + cb.ID.Replace("CB_", "");
                    break;

                case 1:     // 仅名称
                    val += "," + text;
                    break;

                case 2:     // 编号与名称
                    val += "," + cb.ID.Replace("CB_", "") + "," + text;
                    break;

                default:
                    break;
                }
            }
            val = val.Replace("<font color=green>", "");
            val = val.Replace("</font>", "");

            if (val.Length > 2)
            {
                val = val.Substring(1);
            }
            this.WinClose(val);
        }
Esempio n. 24
0
        void mybtn_SaveAutoFullDtl_Click(object sender, EventArgs e)
        {
            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Cancel)
            {
                this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
                return;
            }

            MapExt  myme  = new MapExt(this.MyPK);
            MapDtls dtls  = new MapDtls(myme.FK_MapData);
            string  info  = "";
            string  error = "";

            foreach (MapDtl dtl in dtls)
            {
                TextBox tb = this.Pub1.GetTextBoxByID("TB_" + dtl.No);
                if (tb.Text.Trim() == "")
                {
                    continue;
                }
                try
                {
                    //DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(tb.Text);
                    //MapAttrs attrs = new MapAttrs(dtl.No);
                    //string err = "";
                    //foreach (DataColumn dc in dt.Columns)
                    //{
                    //    if (attrs.IsExits(MapAttrAttr.KeyOfEn, dc.ColumnName) == false)
                    //    {
                    //        err += "<br>列" + dc.ColumnName + "不能与从表 属性匹配.";
                    //    }
                    //}
                    //if (err != "")
                    //{
                    //    error += "在为("+dtl.Name+")检查sql设置时出现错误:"+err;
                    //}
                }
                catch (Exception ex)
                {
                    this.Alert("SQL ERROR: " + ex.Message);
                    return;
                }
                info += "$" + dtl.No + ":" + tb.Text;
            }

            if (error != "")
            {
                this.Pub1.AddEasyUiPanelInfo("错误", "设置错误,请更正:<br />" + error, "icon-no");
                //this.Pub1.AddMsgOfWarning("设置错误,请更正:", error);
                return;
            }
            myme.Tag1 = info;
            myme.Update();
            this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
        }
Esempio n. 25
0
        public string AutoFullDtlField_Delete()
        {
            MapExt me = new MapExt();

            me.Delete(MapExtAttr.ExtType, MapExtXmlList.AutoFullDtlField,
                      MapExtAttr.FK_MapData, this.FK_MapData,
                      MapExtAttr.AttrOfOper, this.KeyOfEn);

            return("删除成功.");
        }
Esempio n. 26
0
        protected void Btn_Delete_Click(object sender, EventArgs e)
        {
            MapExt me = new MapExt();

            me.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData, this.ExtType, this.ExtType, MapExtAttr.AttrOfOper, this.RefNo);
            me.Doc = "";
            me.Update();

            BP.Sys.PubClass.WinClose();
        }
Esempio n. 27
0
        public string ActiveDDL_Delete()
        {
            MapExt me = new MapExt();

            me.Delete(MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                      MapExtAttr.FK_MapData, this.FK_MapData,
                      MapExtAttr.AttrOfOper, this.KeyOfEn);

            return("删除成功.");
        }
Esempio n. 28
0
        public string DDLFullCtrl_Delete()
        {
            MapExt me = new MapExt();

            me.Delete(MapExtAttr.ExtType, MapExtXmlList.DDLFullCtrl,
                      MapExtAttr.FK_MapData, this.FK_MapData,
                      MapExtAttr.AttrOfOper, this.KeyOfEn);

            return("删除成功.");
        }
Esempio n. 29
0
        void btn_SaveAutoFull_Click(object sender, EventArgs e)
        {
            MapExt me = new MapExt();

            //删除指定的数据,避免插入重复.
            me.Delete(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.ExtType, this.ExtType, MapExtAttr.AttrOfOper, this.RefNo);

            me.MyPK = this.MyPK;
            if (me.MyPK.Length > 2)
            {
                me.RetrieveFromDBSources();
            }

            me            = (MapExt)this.Pub1.Copy(me);
            me.ExtType    = this.ExtType;
            me.Doc        = this.Pub1.GetTextBoxByID("TB_Doc").Text;
            me.AttrOfOper = this.RefNo;
            me.FK_MapData = this.FK_MapData;
            me.MyPK       = this.FK_MapData + "_" + me.ExtType + "_" + me.AttrOfOper;
            try
            {
                //DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(me.Doc);
                //if (string.IsNullOrEmpty(me.Tag) == false)
                //{
                //    dt = BP.DA.DBAccess.RunSQLReturnTable(me.Tag);
                //    if (dt.Columns.Contains("Name") == false || dt.Columns.Contains("No") == false)
                //        throw new Exception("在您的sql表达式里,必须有No,Name 还两个列。");
                //}

                //if (this.ExtType == MapExtXmlList.TBFullCtrl)
                //{
                //    if (dt.Columns.Contains("Name") == false || dt.Columns.Contains("No") == false)
                //        throw new Exception("在您的sql表达式里,必须有No,Name 还两个列。");
                //}

                //MapAttrs attrs = new MapAttrs(this.FK_MapData);
                //foreach (DataColumn dc in dt.Columns)
                //{
                //    if (dc.ColumnName.ToLower() == "no" || dc.ColumnName.ToLower() == "name")
                //        continue;

                //    if (attrs.Contains(MapAttrAttr.KeyOfEn, dc.ColumnName) == false)
                //        throw new Exception("@系统没有找到您要匹配的列(" + dc.ColumnName + "),注意:您要指定的列名区分大小写。");
                //}
                me.Save();
            }
            catch (Exception ex)
            {
                this.Pub1.AlertMsg_Warning("SQL错误", ex.Message);
                return;
            }
            this.Response.Redirect("TBFullCtrl.aspx?FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "&MyPK=" + this.MyPK + "", true);
        }
Esempio n. 30
0
        void btn_Del_Click(object sender, EventArgs e)
        {
            MapExt me = new MapExt();

            // me.MyPK = this.FK_MapData + "_" + this.ExtType + "_" + me.AttrOfOper + "_" + me.AttrsOfActive;
            me.Delete(MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.ExtType, MapExtXmlList.ActiveDDL,
                      MapExtAttr.AttrOfOper, this.RefNo);

            //关闭.
            BP.Sys.PubClass.Alert("删除成功.");
            BP.Sys.PubClass.WinClose();
        }