Exemple #1
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="enName"></param>
        /// <returns></returns>
        public int RetrieveFieldGroup(string enName)
        {
            QueryObject qo = new QueryObject(this);

            qo.AddWhere(GroupFieldAttr.FrmID, enName);
            qo.addAnd();
            qo.AddWhereIsNull(GroupFieldAttr.CtrlID);
            //qo.AddWhereLen(GroupFieldAttr.CtrlID, " = ", 0, SystemConfig.AppCenterDBType);
            int num = qo.DoQuery();

            if (num == 0)
            {
                GroupField gf = new GroupField();
                gf.FrmID = enName;
                MapData md = new MapData();
                md.No = enName;
                if (md.RetrieveFromDBSources() == 0)
                {
                    gf.Lab = "基础信息";
                }
                else
                {
                    gf.Lab = md.Name;
                }
                gf.Idx = 0;
                gf.Insert();
                this.AddEntity(gf);
                return(1);
            }
            return(num);
        }
Exemple #2
0
        /// <summary>
        /// 删除之后.
        /// </summary>
        protected override void afterDelete()
        {
            GroupField gf = new GroupField();

            gf.Delete(GroupFieldAttr.CtrlID, this.MyPK);

            base.afterDelete();
        }
Exemple #3
0
        protected override bool beforeUpdate()
        {
            GroupField gf = new GroupField();

            gf.Retrieve(GroupFieldAttr.CtrlID, this.MyPK);
            gf.Lab = this.Name;
            gf.Update();

            return(base.beforeUpdate());
        }
Exemple #4
0
        /// <summary>
        /// 插入之后增加一个分组.
        /// </summary>
        protected override void afterInsert()
        {
            GroupField gf = new GroupField();

            gf.FrmID    = this.FK_MapData;
            gf.CtrlID   = this.MyPK;
            gf.CtrlType = "Frame";
            gf.Lab      = this.Name;
            gf.Idx      = 0;
            gf.Insert(); //插入.

            base.afterInsert();
        }
Exemple #5
0
        /// <summary>
        /// 插入之后
        /// </summary>
        protected override void afterInsert()
        {
            GroupField gf = new GroupField();

            if (gf.IsExit(GroupFieldAttr.CtrlID, this.MyPK) == false)
            {
                gf.FrmID    = this.FK_MapData;
                gf.CtrlID   = this.MyPK;
                gf.CtrlType = "Ath";
                gf.Lab      = this.Name;
                gf.Idx      = 0;
                gf.Insert(); //插入.
            }
            base.afterInsert();
        }
Exemple #6
0
        /// <summary>
        /// GroupFields
        /// </summary>
        /// <param name="enName">名称</param>
        public GroupFields(string enName)
        {
            int i = this.Retrieve(GroupFieldAttr.FrmID, enName, GroupFieldAttr.Idx);

            if (i == 0)
            {
                GroupField gf = new GroupField();
                gf.FrmID = enName;
                MapData md = new MapData();
                md.No = enName;
                if (md.RetrieveFromDBSources() == 0)
                {
                    gf.Lab = "基础信息";
                }
                else
                {
                    gf.Lab = md.Name;
                }
                gf.Idx = 0;
                gf.Insert();
                this.AddEntity(gf);
            }
        }