コード例 #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);
        }