Ejemplo n.º 1
0
        public string BuildMetaData()
        {
            string sql = string.Empty;
            sql += "DELETE FROM T_METADATA_ENUM_COMPONENT WHERE F_GUID='" + this._entity.Guid + "'" + Environment.NewLine;
            sql += "INSERT INTO T_METADATA_ENUM_COMPONENT VALUES((SELECT ISNULL(MAX(F_ID),0)+1 FROM T_METADATA_ENUM_COMPONENT),0,'" + this._entity.Guid + "','" + this._entity.Code + "','" + this._entity.Name + "','" + this._entity.Proj.Namespace + "." + this._entity.Code + "','" + this._entity.Proj.Namespace + ".dll" + "','" + this._entity.Proj.Guid + "')" + Environment.NewLine;

            sql += "DELETE FROM T_METADATA_ENUM_COLUMN_COMPONENT WHERE F_ENUMGUID='" + this._entity.Guid + "'" + Environment.NewLine;

            foreach (EnumColumn col in this._entity.ColumnList)
            {
                IBuild b = new BuildEnumColumn(col);
                sql += b.BuildMetaData() + Environment.NewLine;
            }
            return sql;
        }
Ejemplo n.º 2
0
        public string BuildCode()
        {
            string buildCode = EnumCodeTemplate.EnumClassBeginTemplate.Replace(Attributes.Class, _entity.Code);
            buildCode = buildCode.Replace(Attributes.NameSpace, _namespace);

            //基类中已经实现了sysversion和id
            foreach (EnumColumn col in _entity.ColumnList)
            {
                IBuild b = new BuildEnumColumn(col);
                buildCode += b.BuildCode();
            }
            buildCode += EnumCodeTemplate.EnumClassEndTemplate;

            return buildCode;
        }