123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region GSSystem
- public class GSSystem_info : ITableInfo
- {
- #region GSSystem表 字段信息
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 1000;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 系统描述;
- /// </summary>
- public const string cDescription = "Description";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: N;
- /// 默认值: (N'N');
- /// 描述: IsLock;
- /// </summary>
- public const string cIsLock = "IsLock";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: varchar;
- /// 数据长度: 50;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 短名;
- /// </summary>
- public const string cshortName = "shortName";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 300;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 系统长名称;
- /// </summary>
- public const string cSysLongName = "SysLongName";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 20;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 系统编号;
- /// </summary>
- public const string cSystemID = "SystemID";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nvarchar;
- /// 数据长度: 100;
- /// 是否允许为空: Y;
- /// 默认值: ;
- /// 描述: 系统名称;
- /// </summary>
- public const string cSystemName = "SystemName";
- /// <summary>
- /// 为关键字段: N ;
- /// 自动增长: N;
- /// 数据类型: nchar;
- /// 数据长度: 2;
- /// 是否允许为空: Y;
- /// 默认值: ((1));
- /// 描述: 系统类型 (Y为监管系统 N 被监管系统);
- /// </summary>
- public const string cSystemType = "SystemType";
- #endregion
- public GSSystem_info() { }
- public GSSystem_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _Description = UtilStr.StrFromObj(poRow[cDescription]);
- _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
- _shortName = UtilStr.StrFromObj(poRow[cshortName]);
- _SysLongName = UtilStr.StrFromObj(poRow[cSysLongName]);
- _SystemID = UtilStr.StrFromObj(poRow[cSystemID]);
- _SystemName = UtilStr.StrFromObj(poRow[cSystemName]);
- _SystemType = UtilStr.StrFromObj(poRow[cSystemType]);
- }
- public GSSystem_info(string pcSystemID, DBConnSql poDBConn)
- {
- if (pcSystemID.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.GSSystem + " where SystemID='" + pcSystemID + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _Description = "";
- public string Description
- {
- get { return _Description; }
- set { _Description = value; }
- }
- private string _IsLock = "";
- public string IsLock
- {
- get { return _IsLock; }
- set { _IsLock = value; }
- }
- private string _shortName = "";
- public string shortName
- {
- get { return _shortName; }
- set { _shortName = value; }
- }
- private string _SysLongName = "";
- public string SysLongName
- {
- get { return _SysLongName; }
- set { _SysLongName = value; }
- }
- private string _SystemID = "";
- public string SystemID
- {
- get { return _SystemID; }
- set { _SystemID = value; }
- }
- private string _SystemName = "";
- public string SystemName
- {
- get { return _SystemName; }
- set { _SystemName = value; }
- }
- private string _SystemType = "";
- public string SystemType
- {
- get { return _SystemType; }
- set { _SystemType = value; }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("GSSystemRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cDescription, Description);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cIsLock, IsLock);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cshortName, shortName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cSysLongName, SysLongName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cSystemID, SystemID);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cSystemName, SystemName);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cSystemType, SystemType);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.GSSystem + " " +
- " (" + cDescription + "," + cIsLock + "," + cshortName + "," + cSysLongName + "," + cSystemID + "," + cSystemName + "," + cSystemType + ") " +
- " values ('" + _Description + "','" + _IsLock + "','" + _shortName + "','" + _SysLongName + "','" + _SystemID + "','" + _SystemName + "','" + _SystemType + "') ";
- }
- public string UpdateSql()
- {
- return " update " + Tn.GSSystem + " " +
- " set " + cDescription + "='" + _Description + "'," + cIsLock + "='" + _IsLock + "'," + cshortName + "='" + _shortName + "'," + cSysLongName + "='" + _SysLongName + "'," + cSystemName + "='" + _SystemName + "'," + cSystemType + "='" + _SystemType + "' " +
- " where " + cSystemID + "='" + _SystemID + "'";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.GSSystem + " where " + cSystemID + "='" + _SystemID + "'";
- }
- public static bool undelete(string pcID, DBConnSql poConn)
- {
- string lcSql = " update " + Tn.GSSystem + " set " + cIsLock + "='N' " + " where " + cSystemID + "='" + pcID + "'";
- return poConn.ExcuteSqlTran(lcSql);
- }
- public static bool delete(string pcID, DBConnSql poConn)
- {
- string lcSql = " update " + Tn.GSSystem + " set " + cIsLock + "='Y' " + " where " + cSystemID + "='" + pcID + "'";
- return poConn.ExcuteSqlTran(lcSql);
- }
- }
- #endregion
- #region
- public class GSSystem_Qry : rsQuery
- {
- //public GSSystem_Qry(DBConnSql poConnect)
- // : base()
- //{
- // this.Open("select * from " + Tn.GSSystem, poConnect);
- //}
- public String Description
- {
- get { return GetString(GSSystem_info.cDescription); }
- // set { SetField(GSSystem_info.cDescription, value); }
- }
- public Boolean IsLock
- {
- get { return GetBool(GSSystem_info.cIsLock); }
- // set { SetField(GSSystem_info.cIsLock, value); }
- }
- public String shortName
- {
- get { return GetString(GSSystem_info.cshortName); }
- // set { SetField(GSSystem_info.cshortName, value); }
- }
- public String SysLongName
- {
- get { return GetString(GSSystem_info.cSysLongName); }
- // set { SetField(GSSystem_info.cSysLongName, value); }
- }
- public String SystemID
- {
- get { return GetString(GSSystem_info.cSystemID); }
- // set { SetField(GSSystem_info.cSystemID, value); }
- }
- public String SystemName
- {
- get { return GetString(GSSystem_info.cSystemName); }
- // set { SetField(GSSystem_info.cSystemName, value); }
- }
- public Boolean SystemType
- {
- get { return GetBool(GSSystem_info.cSystemType); }
- // set { SetField(GSSystem_info.cSystemType, value); }
- }
- }
- #endregion
- }
|