GSSystem_info.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Data;
  5. using SysBaseLibs;
  6. using System.Web.Script.Serialization;
  7. namespace SysDataLibs.TableClass
  8. {
  9. #region GSSystem
  10. public class GSSystem_info : ITableInfo
  11. {
  12. #region GSSystem表 字段信息
  13. /// <summary>
  14. /// 为关键字段: N ;
  15. /// 自动增长: N;
  16. /// 数据类型: nvarchar;
  17. /// 数据长度: 1000;
  18. /// 是否允许为空: Y;
  19. /// 默认值: ;
  20. /// 描述: 系统描述;
  21. /// </summary>
  22. public const string cDescription = "Description";
  23. /// <summary>
  24. /// 为关键字段: N ;
  25. /// 自动增长: N;
  26. /// 数据类型: nchar;
  27. /// 数据长度: 2;
  28. /// 是否允许为空: N;
  29. /// 默认值: (N'N');
  30. /// 描述: IsLock;
  31. /// </summary>
  32. public const string cIsLock = "IsLock";
  33. /// <summary>
  34. /// 为关键字段: N ;
  35. /// 自动增长: N;
  36. /// 数据类型: varchar;
  37. /// 数据长度: 50;
  38. /// 是否允许为空: Y;
  39. /// 默认值: ;
  40. /// 描述: 短名;
  41. /// </summary>
  42. public const string cshortName = "shortName";
  43. /// <summary>
  44. /// 为关键字段: N ;
  45. /// 自动增长: N;
  46. /// 数据类型: nvarchar;
  47. /// 数据长度: 300;
  48. /// 是否允许为空: Y;
  49. /// 默认值: ;
  50. /// 描述: 系统长名称;
  51. /// </summary>
  52. public const string cSysLongName = "SysLongName";
  53. /// <summary>
  54. /// 为关键字段: Y --- PrimaryKey;
  55. /// 自动增长: N;
  56. /// 数据类型: nchar;
  57. /// 数据长度: 20;
  58. /// 是否允许为空: N;
  59. /// 默认值: ;
  60. /// 描述: 系统编号;
  61. /// </summary>
  62. public const string cSystemID = "SystemID";
  63. /// <summary>
  64. /// 为关键字段: N ;
  65. /// 自动增长: N;
  66. /// 数据类型: nvarchar;
  67. /// 数据长度: 100;
  68. /// 是否允许为空: Y;
  69. /// 默认值: ;
  70. /// 描述: 系统名称;
  71. /// </summary>
  72. public const string cSystemName = "SystemName";
  73. /// <summary>
  74. /// 为关键字段: N ;
  75. /// 自动增长: N;
  76. /// 数据类型: nchar;
  77. /// 数据长度: 2;
  78. /// 是否允许为空: Y;
  79. /// 默认值: ((1));
  80. /// 描述: 系统类型 (Y为监管系统 N 被监管系统);
  81. /// </summary>
  82. public const string cSystemType = "SystemType";
  83. #endregion
  84. public GSSystem_info() { }
  85. public GSSystem_info(DataRow poRow)
  86. {
  87. CreateTableInfo(poRow);
  88. }
  89. public void CreateTableInfo(DataRow poRow)
  90. {
  91. _Description = UtilStr.StrFromObj(poRow[cDescription]);
  92. _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
  93. _shortName = UtilStr.StrFromObj(poRow[cshortName]);
  94. _SysLongName = UtilStr.StrFromObj(poRow[cSysLongName]);
  95. _SystemID = UtilStr.StrFromObj(poRow[cSystemID]);
  96. _SystemName = UtilStr.StrFromObj(poRow[cSystemName]);
  97. _SystemType = UtilStr.StrFromObj(poRow[cSystemType]);
  98. }
  99. public GSSystem_info(string pcSystemID, DBConnSql poDBConn)
  100. {
  101. if (pcSystemID.Trim().Length > 0 && poDBConn != null)
  102. {
  103. string lcSql = "select * from " + Tn.GSSystem + " where SystemID='" + pcSystemID + "'";
  104. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  105. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
  106. {
  107. loQuery.MoveFirst();
  108. CreateTableInfo(loQuery.CurrentRow);
  109. }
  110. }
  111. }
  112. private string _Description = "";
  113. public string Description
  114. {
  115. get { return _Description; }
  116. set { _Description = value; }
  117. }
  118. private string _IsLock = "";
  119. public string IsLock
  120. {
  121. get { return _IsLock; }
  122. set { _IsLock = value; }
  123. }
  124. private string _shortName = "";
  125. public string shortName
  126. {
  127. get { return _shortName; }
  128. set { _shortName = value; }
  129. }
  130. private string _SysLongName = "";
  131. public string SysLongName
  132. {
  133. get { return _SysLongName; }
  134. set { _SysLongName = value; }
  135. }
  136. private string _SystemID = "";
  137. public string SystemID
  138. {
  139. get { return _SystemID; }
  140. set { _SystemID = value; }
  141. }
  142. private string _SystemName = "";
  143. public string SystemName
  144. {
  145. get { return _SystemName; }
  146. set { _SystemName = value; }
  147. }
  148. private string _SystemType = "";
  149. public string SystemType
  150. {
  151. get { return _SystemType; }
  152. set { _SystemType = value; }
  153. }
  154. [ScriptIgnore]
  155. public rsXmlNode DataXMLNode
  156. {
  157. get
  158. {
  159. rsXmlNode loMainNode = new rsXmlNode("GSSystemRecord", "");
  160. rsXmlNode loNode = null;
  161. loNode = new rsXmlNode(cDescription, Description);
  162. loMainNode.AddChild(loNode);
  163. loNode = new rsXmlNode(cIsLock, IsLock);
  164. loMainNode.AddChild(loNode);
  165. loNode = new rsXmlNode(cshortName, shortName);
  166. loMainNode.AddChild(loNode);
  167. loNode = new rsXmlNode(cSysLongName, SysLongName);
  168. loMainNode.AddChild(loNode);
  169. loNode = new rsXmlNode(cSystemID, SystemID);
  170. loMainNode.AddChild(loNode);
  171. loNode = new rsXmlNode(cSystemName, SystemName);
  172. loMainNode.AddChild(loNode);
  173. loNode = new rsXmlNode(cSystemType, SystemType);
  174. loMainNode.AddChild(loNode);
  175. return loMainNode;
  176. }
  177. }
  178. public string InsertSql()
  179. {
  180. return " insert into " + Tn.GSSystem + " " +
  181. " (" + cDescription + "," + cIsLock + "," + cshortName + "," + cSysLongName + "," + cSystemID + "," + cSystemName + "," + cSystemType + ") " +
  182. " values ('" + _Description + "','" + _IsLock + "','" + _shortName + "','" + _SysLongName + "','" + _SystemID + "','" + _SystemName + "','" + _SystemType + "') ";
  183. }
  184. public string UpdateSql()
  185. {
  186. return " update " + Tn.GSSystem + " " +
  187. " set " + cDescription + "='" + _Description + "'," + cIsLock + "='" + _IsLock + "'," + cshortName + "='" + _shortName + "'," + cSysLongName + "='" + _SysLongName + "'," + cSystemName + "='" + _SystemName + "'," + cSystemType + "='" + _SystemType + "' " +
  188. " where " + cSystemID + "='" + _SystemID + "'";
  189. }
  190. public string DeleteSql()
  191. {
  192. return "Delete " + Tn.GSSystem + " where " + cSystemID + "='" + _SystemID + "'";
  193. }
  194. public static bool undelete(string pcID, DBConnSql poConn)
  195. {
  196. string lcSql = " update " + Tn.GSSystem + " set " + cIsLock + "='N' " + " where " + cSystemID + "='" + pcID + "'";
  197. return poConn.ExcuteSqlTran(lcSql);
  198. }
  199. public static bool delete(string pcID, DBConnSql poConn)
  200. {
  201. string lcSql = " update " + Tn.GSSystem + " set " + cIsLock + "='Y' " + " where " + cSystemID + "='" + pcID + "'";
  202. return poConn.ExcuteSqlTran(lcSql);
  203. }
  204. }
  205. #endregion
  206. #region
  207. public class GSSystem_Qry : rsQuery
  208. {
  209. //public GSSystem_Qry(DBConnSql poConnect)
  210. // : base()
  211. //{
  212. // this.Open("select * from " + Tn.GSSystem, poConnect);
  213. //}
  214. public String Description
  215. {
  216. get { return GetString(GSSystem_info.cDescription); }
  217. // set { SetField(GSSystem_info.cDescription, value); }
  218. }
  219. public Boolean IsLock
  220. {
  221. get { return GetBool(GSSystem_info.cIsLock); }
  222. // set { SetField(GSSystem_info.cIsLock, value); }
  223. }
  224. public String shortName
  225. {
  226. get { return GetString(GSSystem_info.cshortName); }
  227. // set { SetField(GSSystem_info.cshortName, value); }
  228. }
  229. public String SysLongName
  230. {
  231. get { return GetString(GSSystem_info.cSysLongName); }
  232. // set { SetField(GSSystem_info.cSysLongName, value); }
  233. }
  234. public String SystemID
  235. {
  236. get { return GetString(GSSystem_info.cSystemID); }
  237. // set { SetField(GSSystem_info.cSystemID, value); }
  238. }
  239. public String SystemName
  240. {
  241. get { return GetString(GSSystem_info.cSystemName); }
  242. // set { SetField(GSSystem_info.cSystemName, value); }
  243. }
  244. public Boolean SystemType
  245. {
  246. get { return GetBool(GSSystem_info.cSystemType); }
  247. // set { SetField(GSSystem_info.cSystemType, value); }
  248. }
  249. }
  250. #endregion
  251. }