123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region Sys_TableColumns
- public class Sys_TableColumns_info : ITableInfo
- {
- #region Sys_TableColumns表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 是否允许空;
- /// </summary>
- public const string cAllowNull = "AllowNull";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 是否自增长;
- /// </summary>
- public const string cAutoGen = "AutoGen";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ((0));
- /// 描述: 字段长;
- /// </summary>
- public const string cCharNum = "CharNum";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ((0));
- /// 描述: 小数点;
- /// </summary>
- public const string cColDecimal = "ColDecimal";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 200;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 列描述;
- /// </summary>
- public const string cColDesc = "ColDesc";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ((0));
- /// 描述: 列精度;
- /// </summary>
- public const string cColPrecision = "ColPrecision";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 160;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 列名;
- /// </summary>
- public const string cColumnId = "ColumnId";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 列含义;
- /// </summary>
- public const string cColumnName = "ColumnName";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 40;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 数据类型;
- /// </summary>
- public const string cDataType = "DataType";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 缺省值;
- /// </summary>
- public const string cDefValue = "DefValue";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 显示值;
- /// </summary>
- public const string cDisplayValue = "DisplayValue";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 300;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 格式;
- /// </summary>
- public const string cFormat = "Format";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: (N'Y');
- /// 描述: 是否选定;
- /// </summary>
- public const string cIsSelect = "IsSelect";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 是否可见;
- /// </summary>
- public const string cIsVisable = "IsVisable";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 是否主键;
- /// </summary>
- public const string cPrimaryKey = "PrimaryKey";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 200;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 和其他表关联列;
- /// </summary>
- public const string cRelationColumns = "RelationColumns";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 序号;
- /// </summary>
- public const string cSequence = "Sequence";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 160;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 表名;
- /// </summary>
- public const string cTableId = "TableId";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 宽度;
- /// </summary>
- public const string cWidth = "Width";
- #endregion
- public Sys_TableColumns_info() { }
- public Sys_TableColumns_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _AllowNull = UtilStr.StrFromObj(poRow[cAllowNull]);
- _AutoGen = UtilStr.StrFromObj(poRow[cAutoGen]);
- _CharNum = UtilStr.StrFromObj(poRow[cCharNum]);
- _ColDecimal = UtilStr.StrFromObj(poRow[cColDecimal]);
- _ColDesc = UtilStr.StrFromObj(poRow[cColDesc]);
- _ColPrecision = UtilStr.StrFromObj(poRow[cColPrecision]);
- _ColumnId = UtilStr.StrFromObj(poRow[cColumnId]);
- _ColumnName = UtilStr.StrFromObj(poRow[cColumnName]);
- _DataType = UtilStr.StrFromObj(poRow[cDataType]);
- _DefValue = UtilStr.StrFromObj(poRow[cDefValue]);
- _DisplayValue = UtilStr.StrFromObj(poRow[cDisplayValue]);
- _Format = UtilStr.StrFromObj(poRow[cFormat]);
- _IsSelect = UtilStr.StrFromObj(poRow[cIsSelect]);
- _IsVisable = UtilStr.StrFromObj(poRow[cIsVisable]);
- _PrimaryKey = UtilStr.StrFromObj(poRow[cPrimaryKey]);
- _RelationColumns = UtilStr.StrFromObj(poRow[cRelationColumns]);
- _Sequence = UtilStr.StrFromObj(poRow[cSequence]);
- _TableId = UtilStr.StrFromObj(poRow[cTableId]);
- _Width = UtilStr.StrFromObj(poRow[cWidth]);
- }
- public Sys_TableColumns_info(string pcColumnId, string pcTableId, DBConnSql poDBConn)
- {
- if (pcColumnId.Trim().Length > 0 && pcTableId.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.Sys_TableColumns + " where ColumnId='" + pcColumnId + "' and TableId='" + pcTableId + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _AllowNull = "";
- public string AllowNull
- {
- get { return _AllowNull; }
- set { _AllowNull = value; }
- }
- private string _AutoGen = "";
- public string AutoGen
- {
- get { return _AutoGen; }
- set { _AutoGen = value; }
- }
- private string _CharNum = "";
- public string CharNum
- {
- get { return _CharNum; }
- set { _CharNum = value; }
- }
- private string _ColDecimal = "0";
- public string ColDecimal
- {
- get { return _ColDecimal; }
- set { _ColDecimal = value; }
- }
- private string _ColDesc = "";
- public string ColDesc
- {
- get { return _ColDesc; }
- set { _ColDesc = value; }
- }
- private string _ColPrecision = "0";
- public string ColPrecision
- {
- get { return _ColPrecision; }
- set { _ColPrecision = value; }
- }
- private string _ColumnId = "";
- public string ColumnId
- {
- get { return _ColumnId; }
- set { _ColumnId = value; }
- }
- private string _ColumnName = "";
- public string ColumnName
- {
- get { return _ColumnName; }
- set { _ColumnName = value; }
- }
- private string _DataType = "";
- public string DataType
- {
- get { return _DataType; }
- set { _DataType = value; }
- }
- private string _DefValue = "";
- public string DefValue
- {
- get { return _DefValue; }
- set { _DefValue = value; }
- }
- private string _DisplayValue = "";
- public string DisplayValue
- {
- get { return _DisplayValue; }
- set { _DisplayValue = value; }
- }
- private string _Format = "";
- public string Format
- {
- get { return _Format; }
- set { _Format = value; }
- }
- private string _IsSelect = "";
- public string IsSelect
- {
- get { return _IsSelect; }
- set { _IsSelect = value; }
- }
- private string _IsVisable = "";
- public string IsVisable
- {
- get { return _IsVisable; }
- set { _IsVisable = value; }
- }
- private string _PrimaryKey = "";
- public string PrimaryKey
- {
- get { return _PrimaryKey; }
- set { _PrimaryKey = value; }
- }
- private string _RelationColumns = "";
- public string RelationColumns
- {
- get { return _RelationColumns; }
- set { _RelationColumns = value; }
- }
- private string _Sequence = "";
- public string Sequence
- {
- get { return _Sequence; }
- set { _Sequence = value; }
- }
- private string _TableId = "";
- public string TableId
- {
- get { return _TableId; }
- set { _TableId = value; }
- }
- private string _Width = "";
- public string Width
- {
- get { return _Width; }
- set { _Width = value; }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("Sys_TableColumnsRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cAllowNull, AllowNull);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cAutoGen, AutoGen);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cCharNum, CharNum);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cColDecimal, ColDecimal);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cColDesc, ColDesc);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cColPrecision, ColPrecision);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cColumnId, ColumnId);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cColumnName, ColumnName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cDataType, DataType);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cDefValue, DefValue);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cDisplayValue, DisplayValue);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cFormat, Format);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsSelect, IsSelect);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsVisable, IsVisable);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cPrimaryKey, PrimaryKey);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cRelationColumns, RelationColumns);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cSequence, Sequence);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cTableId, TableId);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cWidth, Width);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.Sys_TableColumns + " " +
- " (" + cAllowNull + "," + cAutoGen + "," + cCharNum + "," + cColDecimal + "," + cColDesc + "," + cColPrecision + "," + cColumnId + "," + cColumnName + "," + cDataType + "," + cDefValue + "," + cDisplayValue + "," + cFormat + "," + cIsSelect + "," + cIsVisable + "," + cPrimaryKey + "," + cRelationColumns + "," + cSequence + "," + cTableId + "," + cWidth + ") " +
- " values ('" + _AllowNull + "','" + _AutoGen + "'," + _CharNum + "," + _ColDecimal + ",'" + _ColDesc + "'," + _ColPrecision + ",'" + _ColumnId + "','" + _ColumnName + "','" + _DataType + "','" + _DefValue + "','" + _DisplayValue + "','" + _Format + "','" + _IsSelect + "','" + _IsVisable + "','" + _PrimaryKey + "','" + _RelationColumns + "'," + _Sequence + ",'" + _TableId + "'," + _Width + ") ";
- }
- public string UpdateSql()
- {
- return " update " + Tn.Sys_TableColumns + " " +
- " set " + cAllowNull + "='" + _AllowNull + "'," + cAutoGen + "='" + _AutoGen + "'," + cCharNum + "=" + _CharNum + "," + cColDecimal + "=" + _ColDecimal + "," + cColDesc + "='" + _ColDesc + "'," + cColPrecision + "=" + _ColPrecision + "," + cColumnName + "='" + _ColumnName + "'," + cDataType + "='" + _DataType + "'," + cDefValue + "='" + _DefValue + "'," + cDisplayValue + "='" + _DisplayValue + "'," + cFormat + "='" + _Format + "'," + cIsSelect + "='" + _IsSelect + "'," + cIsVisable + "='" + _IsVisable + "'," + cPrimaryKey + "='" + _PrimaryKey + "'," + cRelationColumns + "='" + _RelationColumns + "'," + cSequence + "=" + _Sequence + "," + cWidth + "=" + _Width + " " +
- " where " + cColumnId + "='" + _ColumnId + "' and " + cTableId + "='" + _TableId + "'";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.Sys_TableColumns + " where " + cColumnId + "='" + _ColumnId + "' and " + cTableId + "='" + _TableId + "'";
- }
- public static string SelectSql(string pcTableID)
- {
- return "select TableID,ColumnId,ColumnName from " + Tn.Sys_TableColumns + " where " + Sys_TableColumns_info.cTableId + "='" + pcTableID + "'";
- }
- }
- #endregion
- #region
- public class Sys_TableColumns_Qry : rsQuery
- {
- public Boolean AllowNull
- {
- get { return GetBool(Sys_TableColumns_info.cAllowNull); }
- // set { SetField(Sys_TableColumns_info.cAllowNull, value); }
- }
-
- public Boolean AutoGen
- {
- get { return GetBool(Sys_TableColumns_info.cAutoGen); }
- // set { SetField(Sys_TableColumns_info.cAutoGen, value); }
- }
-
- public Int64 CharNum
- {
- get { return GetInt(Sys_TableColumns_info.cCharNum); }
- // set { SetField(Sys_TableColumns_info.cCharNum, value); }
- }
-
- public Int64 ColDecimal
- {
- get { return GetInt(Sys_TableColumns_info.cColDecimal); }
- // set { SetField(Sys_TableColumns_info.cColDecimal, value); }
- }
-
- public String ColDesc
- {
- get { return GetString(Sys_TableColumns_info.cColDesc); }
- // set { SetField(Sys_TableColumns_info.cColDesc, value); }
- }
-
- public Int64 ColPrecision
- {
- get { return GetInt(Sys_TableColumns_info.cColPrecision); }
- // set { SetField(Sys_TableColumns_info.cColPrecision, value); }
- }
-
- public String ColumnId
- {
- get { return GetString(Sys_TableColumns_info.cColumnId); }
- // set { SetField(Sys_TableColumns_info.cColumnId, value); }
- }
-
- public String ColumnName
- {
- get { return GetString(Sys_TableColumns_info.cColumnName); }
- // set { SetField(Sys_TableColumns_info.cColumnName, value); }
- }
-
- public String DataType
- {
- get { return GetString(Sys_TableColumns_info.cDataType); }
- // set { SetField(Sys_TableColumns_info.cDataType, value); }
- }
-
- public String DefValue
- {
- get { return GetString(Sys_TableColumns_info.cDefValue); }
- // set { SetField(Sys_TableColumns_info.cDefValue, value); }
- }
-
- public String DisplayValue
- {
- get { return GetString(Sys_TableColumns_info.cDisplayValue); }
- // set { SetField(Sys_TableColumns_info.cDisplayValue, value); }
- }
-
- public String Format
- {
- get { return GetString(Sys_TableColumns_info.cFormat); }
- // set { SetField(Sys_TableColumns_info.cFormat, value); }
- }
-
- public Boolean IsSelect
- {
- get { return GetBool(Sys_TableColumns_info.cIsSelect); }
- // set { SetField(Sys_TableColumns_info.cIsSelect, value); }
- }
-
- public Boolean IsVisable
- {
- get { return GetBool(Sys_TableColumns_info.cIsVisable); }
- // set { SetField(Sys_TableColumns_info.cIsVisable, value); }
- }
-
- public Boolean PrimaryKey
- {
- get { return GetBool(Sys_TableColumns_info.cPrimaryKey); }
- // set { SetField(Sys_TableColumns_info.cPrimaryKey, value); }
- }
-
- public String RelationColumns
- {
- get { return GetString(Sys_TableColumns_info.cRelationColumns); }
- // set { SetField(Sys_TableColumns_info.cRelationColumns, value); }
- }
-
- public Int64 Sequence
- {
- get { return GetInt(Sys_TableColumns_info.cSequence); }
- // set { SetField(Sys_TableColumns_info.cSequence, value); }
- }
-
- public String TableId
- {
- get { return GetString(Sys_TableColumns_info.cTableId); }
- // set { SetField(Sys_TableColumns_info.cTableId, value); }
- }
-
- public Int64 Width
- {
- get { return GetInt(Sys_TableColumns_info.cWidth); }
- // set { SetField(Sys_TableColumns_info.cWidth, value); }
- }
-
- }
- #endregion
- }
|