CheckMethod_info.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 CheckMethod
  10. public class CheckMethod_info : ITableInfo
  11. {
  12. #region CheckMethod表 字段信息
  13. /// <summary>
  14. /// 为关键字段: Y --- PrimaryKey;
  15. /// 自动增长: Y;
  16. /// 数据类型: int;
  17. /// 数据长度: 4;
  18. /// 是否允许为空: N;
  19. /// 默认值: ;
  20. /// 描述: CheckMethodId;
  21. /// </summary>
  22. public const string cCheckMethodId = "CheckMethodId";
  23. /// <summary>
  24. /// 为关键字段: N ;
  25. /// 自动增长: N;
  26. /// 数据类型: nvarchar;
  27. /// 数据长度: 100;
  28. /// 是否允许为空: N;
  29. /// 默认值: ;
  30. /// 描述: CheckMethodName;
  31. /// </summary>
  32. public const string cCheckMethodName = "CheckMethodName";
  33. /// <summary>
  34. /// 为关键字段: N ;
  35. /// 自动增长: N;
  36. /// 数据类型: nchar;
  37. /// 数据长度: 2;
  38. /// 是否允许为空: Y;
  39. /// 默认值: ;
  40. /// 描述: IsLock;
  41. /// </summary>
  42. public const string cIsLock = "IsLock";
  43. /// <summary>
  44. /// 为关键字段: N ;
  45. /// 自动增长: N;
  46. /// 数据类型: nvarchar;
  47. /// 数据长度: -1;
  48. /// 是否允许为空: Y;
  49. /// 默认值: ;
  50. /// 描述: Remark;
  51. /// </summary>
  52. public const string cRemark = "Remark";
  53. /// <summary>
  54. /// 为关键字段: N ;
  55. /// 自动增长: N;
  56. /// 数据类型: int;
  57. /// 数据长度: 4;
  58. /// 是否允许为空: Y;
  59. /// 默认值: ;
  60. /// 描述: Sort;
  61. /// </summary>
  62. public const string cSort = "Sort";
  63. #endregion
  64. public CheckMethod_info(){}
  65. public CheckMethod_info(DataRow poRow)
  66. {
  67. CreateTableInfo(poRow);
  68. }
  69. public void CreateTableInfo(DataRow poRow)
  70. {
  71. _CheckMethodId=UtilStr.StrFromObj(poRow[cCheckMethodId]);
  72. _CheckMethodName=UtilStr.StrFromObj(poRow[cCheckMethodName]);
  73. _IsLock=UtilStr.StrFromObj(poRow[cIsLock]);
  74. _Remark=UtilStr.StrFromObj(poRow[cRemark]);
  75. _Sort=UtilStr.StrFromObj(poRow[cSort]);
  76. }
  77. public CheckMethod_info( string pcCheckMethodId, DBConnSql poDBConn)
  78. {
  79. if ( pcCheckMethodId.Trim().Length > 0 && poDBConn != null)
  80. {
  81. string lcSql = "select * from " + Tn.CheckMethod + " where CheckMethodId='"+pcCheckMethodId+"'";
  82. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  83. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
  84. {
  85. loQuery.MoveFirst();
  86. CreateTableInfo(loQuery.CurrentRow);
  87. }
  88. }
  89. }
  90. private string _CheckMethodId="";
  91. public string CheckMethodId
  92. {
  93. get { return _CheckMethodId; }
  94. set { _CheckMethodId = value; }
  95. }
  96. private string _CheckMethodName="";
  97. public string CheckMethodName
  98. {
  99. get { return _CheckMethodName; }
  100. set { _CheckMethodName = value; }
  101. }
  102. private string _IsLock="";
  103. public string IsLock
  104. {
  105. get { return _IsLock; }
  106. set { _IsLock = value; }
  107. }
  108. private string _Remark="";
  109. public string Remark
  110. {
  111. get { return _Remark; }
  112. set { _Remark = value; }
  113. }
  114. private string _Sort="";
  115. public string Sort
  116. {
  117. get { return _Sort; }
  118. set { _Sort = value; }
  119. }
  120. [ScriptIgnore]
  121. public rsXmlNode DataXMLNode
  122. {
  123. get
  124. {
  125. rsXmlNode loMainNode = new rsXmlNode("CheckMethodRecord", "");
  126. rsXmlNode loNode =null;
  127. loNode = new rsXmlNode(cCheckMethodId, CheckMethodId);
  128. loMainNode.AddChild(loNode);
  129. loNode = new rsXmlNode(cCheckMethodName, CheckMethodName);
  130. loMainNode.AddChild(loNode);
  131. loNode = new rsXmlNode(cIsLock, IsLock);
  132. loMainNode.AddChild(loNode);
  133. loNode = new rsXmlNode(cRemark, Remark);
  134. loMainNode.AddChild(loNode);
  135. loNode = new rsXmlNode(cSort, Sort);
  136. loMainNode.AddChild(loNode);
  137. return loMainNode ;
  138. }
  139. }
  140. public string InsertSql()
  141. {
  142. return " insert into "+Tn.CheckMethod+" "+
  143. " ("+cCheckMethodName+","+cIsLock+","+cRemark+","+cSort+") "+
  144. " values ('"+_CheckMethodName+"','"+_IsLock+"','"+_Remark+"',"+_Sort+") " ;
  145. }
  146. public string UpdateSql()
  147. {
  148. return " update "+Tn.CheckMethod+" "+
  149. " set "+cCheckMethodName+"='"+_CheckMethodName+"',"+cIsLock+"='"+_IsLock+"',"+cRemark+"='"+_Remark+"',"+cSort+"="+_Sort+" "+
  150. " where "+cCheckMethodId+"="+_CheckMethodId+"" ;
  151. }
  152. public string DeleteSql()
  153. {
  154. return "Delete "+Tn.CheckMethod+" where "+cCheckMethodId+"="+_CheckMethodId+"" ;
  155. }
  156. }
  157. #endregion
  158. #region
  159. public class CheckMethod_Qry : rsQuery
  160. {
  161. public Int64 CheckMethodId
  162. {
  163. get { return GetInt(CheckMethod_info.cCheckMethodId); }
  164. // set { SetField(CheckMethod_info.cCheckMethodId, value); }
  165. }
  166. public String CheckMethodName
  167. {
  168. get { return GetString(CheckMethod_info.cCheckMethodName); }
  169. // set { SetField(CheckMethod_info.cCheckMethodName, value); }
  170. }
  171. public Boolean IsLock
  172. {
  173. get { return GetBool(CheckMethod_info.cIsLock); }
  174. // set { SetField(CheckMethod_info.cIsLock, value); }
  175. }
  176. public String Remark
  177. {
  178. get { return GetString(CheckMethod_info.cRemark); }
  179. // set { SetField(CheckMethod_info.cRemark, value); }
  180. }
  181. public Int64 Sort
  182. {
  183. get { return GetInt(CheckMethod_info.cSort); }
  184. // set { SetField(CheckMethod_info.cSort, value); }
  185. }
  186. }
  187. #endregion
  188. }