Пример #1
0
        /// <summary>
        /// 数据源
        /// </summary>
        /// <param name="attrs">数据字符串,规则如下:
        /// <para>1.每个字段间用 ^ 来分隔</para>
        /// <para>2.字段的信息间用 ~ 来分隔</para>
        /// <para>3.字段的信息分别为:英文名称,中文名称,数据类型,最大长度,逻辑类型,序号</para>
        /// </param>
        /// <param name="tableName">数据表名称</param>
        public void InitMapAttr(string tableName, string attrs)
        {
            Pub1.AddEasyUiPanelInfo("发送信息", attrs);
            return;

            //删除有可能存在的临时数据.
            string tempStr = tableName + "Tmp";

            MapAttr ma = new MapAttr();

            ma.Delete(MapAttrAttr.FK_MapData, tempStr);

            string[] strs = attrs.Split('^');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                string[] mystrs = str.Split('~');
                ma            = new MapAttr();
                ma.KeyOfEn    = mystrs[0];
                ma.Name       = mystrs[1];
                ma.FK_MapData = tempStr;
                ma.MyDataType = int.Parse(mystrs[2]);
                ma.MaxLen     = int.Parse(mystrs[3]);
                ma.LGType     = (BP.En.FieldTypeS) int.Parse(mystrs[4]);
                ma.Idx        = int.Parse(mystrs[5]);
                ma.MyPK       = tempStr + "_" + ma.KeyOfEn;
                ma.Insert();
            }
        }
Пример #2
0
        public string SaveFKField(string fk_mapData, string fieldKey, string fieldName, string enName, double x, double y)
        {
            try
            {
                MapAttr attr = new MapAttr();
                attr.MyPK = fk_mapData + "_" + fieldKey;
                if (attr.IsExits == true)
                {
                    return("字段{" + fieldKey + "}已经存在.");
                }

                attr.FK_MapData = fk_mapData;
                attr.KeyOfEn    = fieldKey;
                attr.Name       = fieldName;
                attr.MyDataType = DataType.AppString;

                attr.X = float.Parse(x.ToString());
                attr.Y = float.Parse(y.ToString());

                attr.UIBindKey     = enName;
                attr.UIContralType = UIContralType.DDL;
                attr.LGType        = FieldTypeS.FK;
                attr.Insert();
                return("OK");
            }
            catch (Exception ex)
            {
                return("@错误信息:" + ex.Message);
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Response.Write(this.Request.RawUrl);
            this.Title = "编辑枚举类型"; // "编辑枚举类型";
            MapAttr attr = null;

            if (this.RefNo == null)
            {
                attr = new MapAttr();
                string enumKey = this.Request.QueryString["EnumKey"];
                if (enumKey != null)
                {
                    SysEnumMain se = new SysEnumMain(enumKey);
                    attr.KeyOfEn   = enumKey;
                    attr.UIBindKey = enumKey;
                    attr.Name      = se.Name;
                    attr.Name      = se.Name;
                }
            }
            else
            {
                attr = new MapAttr(this.RefNo);
            }
            BindEnum(attr);
        }
Пример #4
0
 /// <summary>
 /// 生成列的计算
 /// </summary>
 /// <param name="pk"></param>
 /// <param name="attrs"></param>
 /// <param name="attr"></param>
 /// <returns></returns>
 public string GenerAutoFull(string pk, MapAttrs attrs, MapAttr attr)
 {
     try
     {
         string left  = "\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + attr.KeyOfEn + "_" + pk).ClientID + ".value = ";
         string right = attr.AutoFullDoc;
         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_" + attr.KeyOfEn + "_" + pk).ClientID + ".value= VirtyMoney(document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + attr.KeyOfEn + "_" + pk).ClientID + ".value ) ;";
         return(s += " C" + attr.KeyOfEn + "();");
     }
     catch (Exception ex)
     {
         this.Alert(ex.Message);
         return("");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 处理活动.
            switch (this.Request.QueryString["ActionType"])
            {
            case "Left":
                MapAttr attr = new MapAttr(this.FK_MapAttr);
                attr.DoUp();

                break;

            case "Right":
                MapAttr attrR = new MapAttr(this.FK_MapAttr);
                attrR.DoDown();
                break;

            default:
                break;
            }
            #endregion 处理活动.

            MapAttrs attrs = new MapAttrs(this.RptNo);
            this.Pub2.AddTable("align=left");
            this.Pub2.AddCaptionLeft("列表字段显示顺序- 移动箭头改变顺序");
            this.Pub2.AddTR();
            this.Pub2.AddTDTitle("序");

            int    idx  = -1;
            string tKey = DateTime.Now.ToString("HHmmddss");
            foreach (MapAttr attr in attrs)
            {
                idx++;
                this.Pub2.Add("<TD class=Title>");
                if (idx != 0)
                {
                    this.Pub2.Add("<a href=\"javascript:DoLeft('" + FK_Flow + "','" + this.RptNo + "','" + attr.MyPK + "','" + tKey + "')\" ><img src='/WF/Img/Arr/Arrowhead_Previous_S.gif' ></a>");
                }

                this.Pub2.Add(attr.Name);

                this.Pub2.Add("<a href=\"javascript:DoRight('" + FK_Flow + "','" + this.RptNo + "','" + attr.MyPK + "','" + tKey + "')\" ><img src='/WF/Img/Arr/Arrowhead_Next_S.gif' ></a>");

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


            for (int i = 0; i < 12; i++)
            {
                this.Pub2.AddTR();
                this.Pub2.AddTDIdx(i);

                foreach (MapAttr attr in attrs)
                {
                    this.Pub2.AddTD();
                }
                this.Pub2.AddTREnd();
            }
            this.Pub2.AddTableEnd();
        }
Пример #6
0
        public void Add()
        {
            MapAttr attr = new MapAttr();

            attr.MyDataType = this.FType;
            attr.FK_MapData = this.MyPK;
            attr.UIIsEnable = true;
            switch (this.FType)
            {
            case DataType.AppString:
                this.EditString(attr);
                break;

            case DataType.AppInt:
            case DataType.AppDateTime:
            case DataType.AppDate:
            case DataType.AppFloat:
            case DataType.AppDouble:
            case DataType.AppMoney:
                this.EditInt(attr);
                break;

            case DataType.AppBoolean:
                this.EditBool(attr);
                break;

            default:
                break;
            }
        }
Пример #7
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;
            }
        }
Пример #8
0
    public string GenerSum(MapAttr mattr, GEDtls dtls)
    {
        return("");
        //string left = "\n  document.forms[0]." + this.ucsys1.GetTBByID("TB_" + mattr.Key).ClientID + ".value = ";
        //string right = "";
        //int i = 0;
        //foreach (GEDtl dtl in dtls)
        //{
        //    string tbID = "TB_" + mattr.Key + "_" + dtl.PKVal;
        //    TB tb = this.ucsys1.GetTBByID(tbID);
        //    if (i == 0)
        //        right += " parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";
        //    else
        //        right += " +parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";

        //    i++;
        //}

        //string s = left + right + " ;";
        //switch (mattr.MyDataType)
        //{
        //    case BP.DA.DataType.AppMoney:
        //    case BP.DA.DataType.AppRate:
        //        return s += "\t\n  document.forms[0]." + this.ucsys1.GetTBByID("TB_" + mattr.Key).ClientID + ".value= VirtyMoney(document.forms[0]." + this.ucsys1.GetTBByID("TB_" + mattr.Key).ClientID + ".value ) ;";
        //    default:
        //        return s;
        //}
    }
Пример #9
0
        public static new GameObject CreateGameObject(MapAttr attrs)
        {
            GameObject ob = new GameObject();

            //ob.AddComponent(typeof(Account));

            return(ob);
        }
Пример #10
0
        public string StandAloneFrm_InitField()
        {
            //字段属性.
            MapAttr attr = new MapAttr();

            attr.MyPK = this.FrmID + "_" + this.KeyOfEn;
            attr.Retrieve();
            return(AttrCond(attr));
        }
Пример #11
0
        public string CondByFrm_InitField()
        {
            //字段属性.
            MapAttr attr = new MapAttr();

            attr.MyPK = "ND" + int.Parse(this.FK_Flow) + "Rpt_" + this.KeyOfEn;
            attr.Retrieve();
            return(AttrCond(attr));
        }
Пример #12
0
        /// <summary>
        /// 删除,把影子字段也要删除.
        /// </summary>
        protected override void afterDelete()
        {
            MapAttr attr = new MapAttr();

            attr.MyPK = attr.FK_MapData + "_" + this.KeyOfEn + "T";
            attr.Delete();

            base.afterDelete();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.BindTop();

            if (this.RefNo == null)
            {
                /*请选择要设置的字段*/
                MapAttrs mattrs = new MapAttrs();
                mattrs.Retrieve(MapAttrAttr.FK_MapData, this.FK_MapData);

                //this.Pub1.AddFieldSet("请选择要设置的字段");
                this.Pub1.AddEasyUiPanelInfoBegin("选择要设置的字段");
                this.Pub1.AddUL("class='navlist'");

                foreach (MapAttr en in mattrs)
                {
                    if (en.UIVisible == false && en.UIIsEnable == false)
                    {
                        continue;
                    }

                    //this.Pub1.AddLi("?FK_MapData=" + this.FK_MapData + "&RefNo=" + en.MyPK + "&ExtType=AutoFull", en.KeyOfEn + " - " + en.Name);
                    this.Pub1.Add("<li style=\"font-weight:bold\"><div><a href=\"?FK_MapData=" + this.FK_MapData +
                                  "&RefNo=" + en.MyPK + "&ExtType=AutoFull\"><span class=\"nav\">" + en.KeyOfEn + " - " +
                                  en.Name + "</span></a></div></li>");
                    ;
                }

                this.Pub1.AddULEnd();
                //this.Pub1.AddFieldSetEnd();
                this.Pub1.AddEasyUiPanelInfoEnd();
                return;
            }

            MapAttr mattr = new MapAttr(this.RefNo);
            Attr    attr  = mattr.HisAttr;

            this.Title = "为[" + mattr.KeyOfEn + "][" + mattr.Name + "]设置自动完成"; // this.ToE("GuideNewField");

            switch (attr.MyDataType)
            {
            case BP.DA.DataType.AppRate:
            case BP.DA.DataType.AppMoney:
            case BP.DA.DataType.AppInt:
            case BP.DA.DataType.AppFloat:
                BindNumType(mattr);
                break;

            case BP.DA.DataType.AppString:
                BindStringType(mattr);
                break;

            default:
                BindStringType(mattr);
                break;
            }
        }
Пример #14
0
        void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            MapAttr attr = new MapAttr(this.RefNo);

            attr.MyDataTypeS = this.Pub1.GetDDLByID("DDL_DTType").SelectedItemStringVal;
            attr.Update();
            this.Response.Redirect("EditF.aspx?DoType=" + this.DoType + "&MyPK=" + this.MyPK + "&RefNo=" + this.RefNo + "&FType=" + attr.MyDataType + "&GroupField=" + this.GroupField, true);
            // this.Response.Redirect(this.Request.RawUrl, true);
        }
Пример #15
0
    public static new GameObject CreateGameObject(MapAttr attrs)
    {
        var worldController = GameObject.Find("GoWorldController");
        var world           = worldController.GetComponent <GoWorldController>();
        var p            = GameObject.Instantiate(world.Player);
        var entityStatus = world.GetEntityStatus();

        p.GetComponent <Player>().Init(entityStatus);
        return(p);
    }
Пример #16
0
    public string GenerLab(MapAttr attr, int idx, int i, int count)
    {
        string divAttr = " onmouseover=FieldOnMouseOver('" + attr.MyPK + "') onmouseout=FieldOnMouseOut('" + attr.MyPK + "') ";
        string lab     = attr.Name;

        if (attr.MyDataType == DataType.AppBoolean && attr.UIIsLine)
        {
            lab = "编辑";
        }

        bool isLeft = true;

        if (i == 1)
        {
            isLeft = false;
        }

        if (attr.HisEditType == EditType.Edit || attr.HisEditType == EditType.UnDel)
        {
            switch (attr.LGType)
            {
            case FieldTypeS.Normal:
                lab = "<a  href=\"javascript:Edit('" + this.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + lab + "</a>";
                break;

            case FieldTypeS.FK:
                lab = "<a  href=\"javascript:EditTable('" + this.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + lab + "</a>";
                break;

            case FieldTypeS.Enum:
                lab = "<a  href=\"javascript:EditEnum('" + this.FK_MapData + "','" + attr.MyPK + "','" + attr.MyDataType + "');\">" + lab + "</a>";
                break;

            default:
                break;
            }
        }
        else
        {
            lab = attr.Name;
        }

        if (idx == 0)
        {
            /*第一个。*/
            return("<div " + divAttr + " >" + lab + "<a href=\"javascript:Down('" + this.FK_MapData + "','" + attr.MyPK + "','1');\" ><img src='./WF/Img/Btn/Right.gif' class='Arrow' alt='向右动顺序' border=0/></a></div>");
        }

        if (idx == count - 1)
        {
            /*到数第一个。*/
            return("<div " + divAttr + " ><a href=\"javascript:Up('" + this.FK_MapData + "','" + attr.MyPK + "','1');\" ><img src='./WF/Img/Btn/Left.gif' alt='向左移动顺序' class='Arrow' border=0/></a>" + lab + "</div>");
        }
        return("<div " + divAttr + " ><a href=\"javascript:Up('" + this.FK_MapData + "','" + attr.MyPK + "','1');\" ><img src='./WF/Img/Btn/Left.gif' alt='向下移动顺序' class='Arrow' border=0/></a>" + lab + "<a href=\"javascript:Down('" + this.FK_MapData + "','" + attr.MyPK + "','1');\" ><img src='./WF/Img/Btn/Right.gif' alt='向右移动顺序' class='Arrow' border=0/></a></div>");
    }
Пример #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.MyPK == null)
            {
                throw new Exception("Mypk==null");
            }

            this.Title = "编辑字段";

            switch (this.DoType)
            {
            case "Add":
                this.Add();
                break;

            case "Edit":
                MapAttr attr = new MapAttr();
                attr.MyPK = this.RefNo;
                attr.RetrieveFromDBSources();
                attr.MyDataType = this.FType;

                if (attr.UIContralType == UIContralType.DDL)
                {
                    this.Response.Redirect("EditSQL.aspx?MyPK=" + this.MyPK + "&RefNo=" + this.RefNo, true);
                    return;
                }

                switch (attr.MyDataType)
                {
                case BP.DA.DataType.AppString:
                    this.EditString(attr);
                    break;

                case BP.DA.DataType.AppDateTime:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppInt:
                case BP.DA.DataType.AppFloat:
                case BP.DA.DataType.AppMoney:
                case BP.DA.DataType.AppDouble:
                    this.EditInt(attr);
                    break;

                case BP.DA.DataType.AppBoolean:
                    this.EditBool(attr);
                    break;

                default:
                    throw new Exception("为考虑的类型" + this.FType);
                }
                break;

            default:
                break;
            }
        }
Пример #18
0
        /// <summary>
        /// 删除,把影子字段也要删除.
        /// </summary>
        protected override void afterDelete()
        {
            MapAttr attr = new MapAttr();

            attr.MyPK = attr.FK_MapData + "_" + this.KeyOfEn + "T";
            attr.Delete();

            //调用frmEditAction, 完成其他的操作.
            BP.Sys.CCFormAPI.AfterFrmEditAction(this.FK_MapData);
            base.afterDelete();
        }
Пример #19
0
        public string GenerSum(MapAttr mattr, GEDtls dtls)
        {
            if (dtls.Count <= 1)
            {
                return("");
            }

            string ClientID = "";

            try
            {
                ClientID = this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID;
            }
            catch
            {
                return("");
            }

            string left  = "\n  document.forms[0]." + ClientID + ".value = ";
            string right = "";
            int    i     = 0;

            foreach (GEDtl dtl in dtls)
            {
                string  tbID = "TB_" + mattr.KeyOfEn + "_" + dtl.OID;
                TextBox tb   = this.Pub1.GetTextBoxByID(tbID);
                if (tb == null)
                {
                    continue;
                }

                if (i == 0)
                {
                    right += " parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";
                }
                else
                {
                    right += " +parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";
                }
                i++;
            }
            string s = left + right + " ;";

            switch (mattr.MyDataType)
            {
            case BP.DA.DataType.AppMoney:
            case BP.DA.DataType.AppRate:
                return(s += "\t\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID + ".value= VirtyMoney(document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID + ".value ) ;");

            default:
                return(s);
            }
        }
Пример #20
0
        protected override void afterInsertUpdateAction()
        {
            MapAttr mapAttr = new MapAttr();

            mapAttr.MyPK = this.MyPK;
            mapAttr.RetrieveFromDBSources();
            mapAttr.Update();

            //调用frmEditAction, 完成其他的操作.
            BP.Sys.CCFormAPI.AfterFrmEditAction(this.FK_MapData);

            base.afterInsertUpdateAction();
        }
Пример #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            switch (this.DoType)
            {
            case "Up":
                MapAttr ma = new MapAttr(this.FK_MapData + "_" + this.KeyOfEn);
                ma.DoUpTabIdx();
                break;

            case "Down":
                MapAttr ma1 = new MapAttr(this.FK_MapData + "_" + this.KeyOfEn);
                ma1.DoDownTabIdx();
                break;

            default:
                break;
            }

            string sql = "SELECT KeyOfEn,Name,IDX FROM Sys_MapAttr WHERE FK_MapData='" + this.FK_MapData + "' AND UIVisible=1  ORDER BY Idx ";

            this.Title = "设置tab键顺序";
            DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql);

            this.Pub1.AddTable("width='100%'");
            this.Pub1.AddCaption("正确的调整好Tab键的顺序,可以方便用户数据录入.");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("字段");
            this.Pub1.AddTDTitle("描述");
            this.Pub1.AddTDTitle("顺序号");
            this.Pub1.AddTDTitle("移动");
            this.Pub1.AddTDTitle("移动");
            this.Pub1.AddTREnd();

            bool is1 = false;
            int  idx = 0;

            foreach (DataRow dr in dt.Rows)
            {
                idx++;
                is1 = this.Pub1.AddTR(is1);
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(dr["KeyOfEn"].ToString());
                this.Pub1.AddTD(dr["Name"].ToString());
                this.Pub1.AddTD(dr["Idx"].ToString());
                this.Pub1.AddTD("<a href='TabIdx.aspx?DoType=Up&FK_MapData=" + this.FK_MapData + "&KeyOfEn=" + dr["KeyOfEn"].ToString() + "' ><img src='../Img/Btn/Up.gif' border=0></a>");
                this.Pub1.AddTD("<a href='TabIdx.aspx?DoType=Down&FK_MapData=" + this.FK_MapData + "&KeyOfEn=" + dr["KeyOfEn"].ToString() + "' ><img src='../Img/Btn/Down.gif' border=0></a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Пример #22
0
        public void Edit()
        {
            MapAttr attr = new MapAttr(this.RefNo);

            switch (attr.MyDataType)
            {
            case BP.DA.DataType.AppString:
                //  this.Response.Redirect("EditF.aspx?RefOID="+this
                break;

            default:
                break;
            }
        }
        void btn_Click(object sender, EventArgs e)
        {
            MapDatas mds      = this.GetMDs;
            MapAttr  mattrOld = new MapAttr(this.FK_MapData, this.KeyOfEn);
            MapAttr  mattr    = new MapAttr(this.FK_MapData, this.KeyOfEn);

            foreach (MapData md in mds)
            {
                CheckBox cb = this.Pub1.GetCBByID("CB_" + md.No);
                if (cb == null)
                {
                    continue;
                }

                if (cb.Checked == false)
                {
                    continue;
                }

                if (this.DoType == "Copy")
                {
                    /*执行批量Copy*/
                    mattr.FK_MapData = md.No;
                    mattr.Insert();
                    mattr.Idx = mattrOld.Idx;
                }

                if (this.DoType == "Update")
                {
                    /*执行批量Update*/
                    MapAttr mattrUpdate = new MapAttr(md.No, this.KeyOfEn);
                    int     gID         = mattrUpdate.GroupID;
                    mattrUpdate.Copy(mattrOld);
                    mattrUpdate.FK_MapData = md.No;
                    mattrUpdate.GroupID    = gID;
                    mattrUpdate.Update();
                }

                if (this.DoType == "Delete")
                {
                    /*执行批量 Delete */
                    MapAttr mattrDelete = new MapAttr(md.No, this.KeyOfEn);
                    mattrDelete.Delete();
                }
            }
            // 转向.
            this.Response.Redirect(this.Request.RawUrl, true);
        }
Пример #24
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string rpt = BP.PubClass.DBRpt(BP.DBLevel.High);

            // 手动升级. 2011-07-08 补充节点字段分组.
            string sql = "DELETE FROM Sys_EnCfg WHERE No='BP.WF.Ext.NodeSheet'";

            BP.DA.DBAccess.RunSQL(sql);

            sql = "INSERT INTO Sys_EnCfg(No,GroupTitle) VALUES ('BP.WF.Ext.NodeSheet','NodeID=基本配置@WarningDays=考核属性@SendLab=功能按钮标签与状态')";
            BP.DA.DBAccess.RunSQL(sql);

            // 修复因bug丢失的字段.
            MapDatas mds = new MapDatas();

            mds.RetrieveAll();
            foreach (MapData md in mds)
            {
                string nodeid = md.No.Replace("ND", "");
                try
                {
                    BP.WF.Node nd = new Node(int.Parse(nodeid));
                    nd.RepareMap();
                    continue;
                }
                catch (Exception ex)
                {
                }

                MapAttr attr = new MapAttr();
                if (attr.IsExit(MapAttrAttr.KeyOfEn, "OID", MapAttrAttr.FK_MapData, md.No) == false)
                {
                    attr.FK_MapData    = md.No;
                    attr.KeyOfEn       = "OID";
                    attr.Name          = "OID";
                    attr.MyDataType    = BP.DA.DataType.AppInt;
                    attr.UIContralType = UIContralType.TB;
                    attr.LGType        = FieldTypeS.Normal;
                    attr.UIVisible     = false;
                    attr.UIIsEnable    = false;
                    attr.DefVal        = "0";
                    attr.HisEditType   = BP.En.EditType.Readonly;
                    attr.Insert();
                }
            }
            return("执行成功...");
        }
Пример #25
0
        /// <summary>
        /// 返回信息。
        /// </summary>
        /// <returns></returns>
        public string RadioBtns_Init()
        {
            DataSet ds = new DataSet();

            //放入表单字段.
            MapAttrs attrs = new MapAttrs(this.FK_MapData);

            ds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr"));

            //属性.
            MapAttr attr = new MapAttr();

            attr.MyPK = this.FK_MapData + "_" + this.KeyOfEn;
            attr.Retrieve();

            //把分组加入里面.
            GroupFields gfs = new GroupFields(this.FK_MapData);

            ds.Tables.Add(gfs.ToDataTableField("Sys_GroupFields"));

            //字段值.
            FrmRBs rbs = new FrmRBs();

            rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn);
            if (rbs.Count == 0)
            {
                /*初始枚举值变化.
                 */
                SysEnums ses = new SysEnums(attr.UIBindKey);
                foreach (SysEnum se in ses)
                {
                    FrmRB rb = new FrmRB();
                    rb.FK_MapData = this.FK_MapData;
                    rb.KeyOfEn    = this.KeyOfEn;
                    rb.IntKey     = se.IntKey;
                    rb.Lab        = se.Lab;
                    rb.EnumKey    = attr.UIBindKey;
                    rb.Insert(); //插入数据.
                }

                rbs.Retrieve(FrmRBAttr.FK_MapData, this.FK_MapData, FrmRBAttr.KeyOfEn, this.KeyOfEn);
            }

            //加入单选按钮.
            ds.Tables.Add(rbs.ToDataTableField("Sys_FrmRB"));
            return(BP.Tools.Json.ToJson(ds));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.MyPK == null)
            {
                throw new Exception("Mypk==null");
            }

            this.Title = "编辑字段";

            switch (this.DoType)
            {
            case "Add":
                this.Add();
                break;

            case "Edit":
                MapAttr attr = new MapAttr();
                attr.MyPK = this.RefNo;
                attr.RetrieveFromDBSources();
                attr.MyDataType = this.FType;
                switch (attr.MyDataType)
                {
                case BP.DA.DataType.AppString:
                    this.EditString(attr);
                    break;

                case BP.DA.DataType.AppDateTime:
                case BP.DA.DataType.AppDate:
                case BP.DA.DataType.AppInt:
                case BP.DA.DataType.AppFloat:
                case BP.DA.DataType.AppMoney:
                    this.EditInt(attr);
                    break;

                case BP.DA.DataType.AppBoolean:
                    this.EditBool(attr);
                    break;

                default:
                    throw new Exception("为考虑的类型" + this.FType);
                }
                break;

            default:
                break;
            }
        }
Пример #27
0
        public string GenerSum(MapAttr mattr, MapDtl dtl)
        {
            if (dtl.IsShowSum == false)
            {
                return("");
            }

            if (mattr.MyDataType == DataType.AppBoolean)
            {
                return("");
            }

            string left  = "\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID + ".value = ";
            string right = "";

            for (int i = 1; i <= dtl.RowsOfList; i++)
            {
                string  tbID = "TB_" + mattr.KeyOfEn + "_" + i;
                TextBox tb   = this.Pub1.GetTextBoxByID(tbID);
                if (tb == null)
                {
                    continue;
                }

                if (i == 0)
                {
                    right += " parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";
                }
                else
                {
                    right += " +parseFloat( document.forms[0]." + tb.ClientID + ".value.replace( ',' ,  '' ) )  ";
                }
            }

            string s = left + right + " ;";

            switch (mattr.MyDataType)
            {
            case BP.DA.DataType.AppMoney:
            case BP.DA.DataType.AppRate:
                return(s += "\t\n  document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID + ".value= VirtyMoney(document.forms[0]." + this.Pub1.GetTextBoxByID("TB_" + mattr.KeyOfEn).ClientID + ".value ) ;");

            default:
                return(s);
            }
        }
Пример #28
0
        /// <summary>
        /// 保存列的顺序名称.
        /// </summary>
        /// <returns></returns>
        public string S3ColsLabel_Save()
        {
            string orders = this.GetRequestVal("Orders");
            //格式为  @KeyOfEn,Lable,idx  比如: @DianHua,电话,1@Addr,地址,2

            string rptNo = this.GetRequestVal("RptNo");

            string[] strs = orders.Split('@');
            foreach (string item in strs)
            {
                if (DataType.IsNullOrEmpty(item) == true)
                {
                    continue;
                }

                string[] vals = item.Split(',');

                string mypk = rptNo + "_" + vals[0];

                MapAttr attr = new MapAttr();
                attr.MyPK = mypk;
                attr.Retrieve();

                attr.Name = vals[1];
                attr.Idx  = int.Parse(vals[2]);

                attr.Update(); //执行更新.
            }

            MapAttr myattr = new MapAttr();

            myattr.MyPK = rptNo + "_OID";
            myattr.RetrieveFromDBSources();
            myattr.Idx  = 200;
            myattr.Name = "工作ID";
            myattr.Update();

            myattr      = new MapAttr();
            myattr.MyPK = rptNo + "_Title";
            myattr.RetrieveFromDBSources();
            myattr.Idx  = -100;
            myattr.Name = "标题";
            myattr.Update();

            return("保存成功..");
        }
Пример #29
0
        /// <summary>
        /// 执行
        /// </summary>
        /// <returns>返回执行结果</returns>
        public override object Do()
        {
            string keys = "~!@#$%^&*()+{}|:<>?`=[];,./~!@#¥%……&×()——+{}|:“《》?`-=[];',./";

            char[] cc = keys.ToCharArray();
            foreach (char c in cc)
            {
                DBAccess.RunSQL("update sys_mapattr set keyofen=REPLACE(keyofen,'" + c + "' , '')");
            }

            BP.Sys.MapAttrs attrs = new Sys.MapAttrs();
            attrs.RetrieveAll();
            int    idx = 0;
            string msg = "";

            foreach (BP.Sys.MapAttr item in attrs)
            {
                string f = item.KeyOfEn.Clone().ToString();
                try
                {
                    int i = int.Parse(item.KeyOfEn.Substring(0, 1));
                    item.KeyOfEn = "F" + item.KeyOfEn;
                    try
                    {
                        MapAttr itemCopy = new MapAttr();
                        itemCopy.Copy(item);
                        itemCopy.Insert();
                        item.DirectDelete();
                    }
                    catch (Exception ex)
                    {
                        msg += "@" + ex.Message;
                    }
                }
                catch
                {
                    continue;
                }
                DBAccess.RunSQL("UPDATE sys_mapAttr set KeyOfEn='" + item.KeyOfEn + "', mypk=FK_MapData+'_'+keyofen where keyofen='" + item.KeyOfEn + "'");
                msg += "@第(" + idx + ")个错误修复成功,原(" + f + ")修复成(" + item.KeyOfEn + ").";
                idx++;
            }

            BP.DA.DBAccess.RunSQL("UPDATE Sys_MapAttr SET MyPK=FK_MapData+'_'+KeyOfEn WHERE MyPK!=FK_MapData+'_'+KeyOfEn");
            return("修复信息如下:" + msg);
        }
Пример #30
0
        public void EditInt(MapAttr mapAttr)
        {
            this.EditBeforeAdd(mapAttr);

            TB tb = new TB();

            this.Pub1.AddTR();
            this.Pub1.AddTDIdx(idx++);
            this.Pub1.AddTD("文本框宽度");
            tb          = new TB();
            tb.ID       = "TB_UIWidth";
            tb.CssClass = "TBNum";
            tb.Text     = mapAttr.UIWidth.ToString();
            this.Pub1.AddTD(tb);
            this.Pub1.AddTDB("对从表有效");
            this.Pub1.AddTREnd();
            this.EditBeforeEnd(mapAttr);
        }