Beispiel #1
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();
        }
Beispiel #2
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("保存成功.");
        }
Beispiel #3
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("保存成功.");
        }
Beispiel #4
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("设置成功.");
        }
Beispiel #5
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);
            }
        }
Beispiel #6
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("保存成功.");
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
Beispiel #9
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();
        }
Beispiel #10
0
        protected void Btn_Save_Click(object sender, EventArgs e)
        {
            MapExt   myme  = new MapExt(this.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;
                }
                if (this.TB_SQL.Text.Trim() == "")
                {
                    continue;
                }
                try
                {
                    DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(this.TB_SQL.Text);
                    if (this.TB_SQL.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 + ":" + this.TB_SQL.Text;
            }

            myme.Tag = info;
            myme.Update();
            this.Alert("保存成功.");
        }
Beispiel #11
0
        /// <summary>
        /// 保存(自动计算: @单价*@数量 模式.)
        /// </summary>
        /// <returns></returns>
        public string AutoFullDtlField_Save()
        {
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.AutoFullDtlField,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            me.FK_MapData = this.FK_MapData;
            me.AttrOfOper = this.KeyOfEn;
            me.Doc        = this.GetValFromFrmByKey("DDL_Dtl") + "." + this.GetValFromFrmByKey("DDL_Field") + "." + this.GetValFromFrmByKey("DDL_JSFS"); //要执行的表达式.

            me.ExtType = MapExtXmlList.AutoFullDtlField;

            //执行保存.
            me.MyPK = MapExtXmlList.AutoFullDtlField + "_" + me.FK_MapData + "_" + me.AttrOfOper;
            if (me.Update() == 0)
            {
                me.Insert();
            }

            return("保存成功.");
        }
Beispiel #12
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public string AutoFullDLL_Save()
        {
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.AutoFullDLL,
                                    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.AutoFullDLL;

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

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

            return("保存成功.");
        }
Beispiel #13
0
        public string Fields_Save()
        {
            Node currND = new Node(this.FK_Node);

            string FieldsAttrsObj = this.GetRequestVal("FieldsAttrsObj");
            var    jsonSetting    = new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            };
            List <FieldsAttrs> fieldsAttrsList = JsonConvert.DeserializeObject <List <FieldsAttrs> >(FieldsAttrsObj, jsonSetting);

            if (fieldsAttrsList == null)
            {
                return("0");
            }

            MapAttrs attrs = new MapAttrs();
            //增加排序
            QueryObject obj = new QueryObject(attrs);

            obj.AddWhere(MapAttrAttr.FK_MapData, this.FK_MapData);
            obj.DoQuery();

            foreach (MapAttr attr in attrs)
            {
                foreach (FieldsAttrs fieldsAttrs in fieldsAttrsList)
                {
                    if (!attr.KeyOfEn.Equals(fieldsAttrs.KeyOfEn))
                    {
                        continue;
                    }

                    if (currND.HisFormType == NodeFormType.RefOneFrmTree)
                    {
                        attr.UIVisible  = fieldsAttrs.UIVisible;
                        attr.UIIsEnable = fieldsAttrs.UIIsEnable;
                        attr.IsSigan    = fieldsAttrs.IsSigan;
                        attr.DefVal     = fieldsAttrs.DefVal;
                        attr.UIIsInput  = fieldsAttrs.IsNotNull;
                        attr.FK_MapData = this.FK_MapData;
                        attr.KeyOfEn    = attr.KeyOfEn;
                        attr.Name       = attr.Name;
                        attr.Update();

                        //如果是表单库表单,需要写入MapAttr
                        if (DataType.IsNullOrEmpty(fieldsAttrs.RegularExp) == false)
                        {
                            MapExt ext       = new MapExt();
                            bool   extisExit = ext.IsExit("MyPK", "RegularExpression_" + this.FK_MapData + "_" + fieldsAttrs.KeyOfEn + "_onchange");

                            ext.FK_MapData = this.FK_MapData;
                            ext.ExtType    = MapExtXmlList.RegularExpression;
                            ext.DoWay      = 0;
                            ext.AttrOfOper = fieldsAttrs.KeyOfEn;
                            ext.Doc        = fieldsAttrs.RegularExp;
                            ext.Tag        = "onchange";
                            ext.Tag1       = "格式不正确!";

                            if (extisExit)
                            {
                                ext.Update();
                            }
                            else
                            {
                                ext.MyPK = "RegularExpression_" + this.FK_MapData + "_" + fieldsAttrs.KeyOfEn + "_onchange";
                                ext.Insert();
                            }
                        }
                    }

                    FrmField frmField = new FrmField();
                    bool     isExit   = frmField.IsExit("MyPK",
                                                        this.FK_MapData + "_" + this.FK_Flow + "_" + this.FK_Node + "_" + fieldsAttrs.KeyOfEn + "_" + FrmEleType.Field);

                    frmField.UIVisible          = fieldsAttrs.UIVisible;
                    frmField.UIIsEnable         = fieldsAttrs.UIIsEnable;
                    frmField.IsSigan            = fieldsAttrs.IsSigan;
                    frmField.DefVal             = fieldsAttrs.DefVal;
                    frmField.IsNotNull          = fieldsAttrs.IsNotNull;
                    frmField.RegularExp         = fieldsAttrs.RegularExp;
                    frmField.IsWriteToFlowTable = fieldsAttrs.IsWriteToFlowTable;
                    //frmField.IsWriteToGenerWorkFlow = fieldsAttrs.IsWriteToGenerWorkFlow;  //sln无此属性
                    frmField.FK_Node    = this.FK_Node;
                    frmField.FK_Flow    = this.FK_Flow;
                    frmField.FK_MapData = this.FK_MapData;
                    frmField.KeyOfEn    = attr.KeyOfEn;
                    frmField.Name       = attr.Name;

                    if (isExit)
                    {
                        frmField.Update();
                    }
                    else
                    {
                        frmField.Insert();
                    }
                }
            }

            return(fieldsAttrsList.Count.ToString());
        }
        /// <summary>
        /// 保存(自动计算: @单价*@数量 模式.)
        /// </summary>
        /// <returns></returns>
        public string AutoFullDtlField_Save()
        {
            MapExt me = new MapExt();
            int    i  = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.AutoFullDtlField,
                                    MapExtAttr.FK_MapData, this.FK_MapData,
                                    MapExtAttr.AttrOfOper, this.KeyOfEn);

            me.FK_MapData = this.FK_MapData;
            me.AttrOfOper = this.KeyOfEn;
            me.Doc        = this.GetValFromFrmByKey("DDL_Dtl") + "." + this.GetValFromFrmByKey("DDL_Field") + "." + this.GetValFromFrmByKey("DDL_JSFS"); //要执行的表达式.

            me.ExtType = MapExtXmlList.AutoFullDtlField;

            me.Tag1 = this.GetValFromFrmByKey("TB_Tag1");
            me.Tag2 = this.GetValFromFrmByKey("TB_Tag2");

            string Tag = "0";

            try
            {
                Tag = this.GetValFromFrmByKey("CB_Tag");
                if (Tag == "on")
                {
                    Tag = "1";
                }
            }
            catch (Exception e)
            {
                Tag = "0";
            }


            me.Tag = Tag;

            string Tag3 = "0";

            try
            {
                Tag3 = this.GetValFromFrmByKey("CB_Tag3");
                if (Tag3 == "on")
                {
                    Tag3 = "1";
                }
            }
            catch (Exception e)
            {
                Tag3 = "0";
            }
            me.Tag3 = Tag3;

            me.Tag4 = this.GetValFromFrmByKey("DDL_Fileds");

            //执行保存.
            me.MyPK = MapExtXmlList.AutoFullDtlField + "_" + me.FK_MapData + "_" + me.AttrOfOper;
            if (me.Update() == 0)
            {
                me.Insert();
            }

            return("保存成功.");
        }
Beispiel #15
0
        void btn_SaveInputCheck_Click(object sender, EventArgs e)
        {
            ListBox lb = this.Pub1.FindControl("LB1") as ListBox;

            // 检查路径. 没有就创建它。
            string pathDir = BP.Sys.SystemConfig.PathOfDataUser + "\\JSLibData\\";

            if (Directory.Exists(pathDir) == false)
            {
                Directory.CreateDirectory(pathDir);
            }

            // 删除已经存在的数据.
            MapExt me = new MapExt();

            me.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData,
                        MapExtAttr.ExtType, this.ExtType,
                        MapExtAttr.AttrOfOper, this.OperAttrKey);

            foreach (ListItem li in lb.Items)
            {
                if (li.Selected == false)
                {
                    continue;
                }

                me         = (MapExt)this.Pub1.Copy(me);
                me.ExtType = this.ExtType;

                // 操作的属性.
                me.AttrOfOper = this.OperAttrKey;

                int doWay = 0;
                if (this.Pub1.GetRadioButtonByID("RB_0").Checked == false)
                {
                    doWay = 1;
                }

                me.DoWay = doWay;
                me.Doc   = BP.DA.DataType.ReadTextFile(li.Value);
                FileInfo info = new FileInfo(li.Value);
                me.Tag2 = info.Directory.Name;

                //获取函数的名称.
                string func = me.Doc;
                func    = me.Doc.Substring(func.IndexOf("function") + 8);
                func    = func.Substring(0, func.IndexOf("("));
                me.Tag1 = func.Trim();

                // 检查路径,没有就创建它.
                FileInfo fi = new FileInfo(li.Value);
                me.Tag        = li.Value;
                me.FK_MapData = this.FK_MapData;
                me.ExtType    = this.ExtType;
                me.MyPK       = this.FK_MapData + "_" + me.ExtType + "_" + me.AttrOfOper + "_" + me.Tag1;
                try
                {
                    me.Insert();
                }
                catch
                {
                    me.Update();
                }
            }

            #region 把所有的js 文件放在一个文件里面。
            MapExts mes = new MapExts();
            mes.Retrieve(MapExtAttr.FK_MapData, this.FK_MapData,
                         MapExtAttr.ExtType, this.ExtType);

            string js = "";
            foreach (MapExt me1 in mes)
            {
                js += "\r\n" + BP.DA.DataType.ReadTextFile(me1.Tag);
            }

            if (File.Exists(pathDir + "\\" + this.FK_MapData + ".js"))
            {
                File.Delete(pathDir + "\\" + this.FK_MapData + ".js");
            }

            BP.DA.DataType.WriteFile(pathDir + "\\" + this.FK_MapData + ".js", js);
            #endregion 把所有的js 文件放在一个文件里面。

            this.Response.Redirect("InputCheck.aspx?FK_MapData=" + this.FK_MapData + "&ExtType=" + this.ExtType + "&RefNo=" + this.RefNo, true);
        }