Standard_info.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 Standard
  10. public class Standard_info : ITableInfo
  11. {
  12. #region Standard表 字段信息
  13. /// <summary>
  14. /// 为关键字段: N ;
  15. /// 自动增长: N;
  16. /// 数据类型: int;
  17. /// 数据长度: 4;
  18. /// 是否允许为空: N;
  19. /// 默认值: (0);
  20. /// 描述: 是否锁定;
  21. /// </summary>
  22. public const string cIsLock = "IsLock";
  23. /// <summary>
  24. /// 为关键字段: N ;
  25. /// 自动增长: N;
  26. /// 数据类型: int;
  27. /// 数据长度: 4;
  28. /// 是否允许为空: N;
  29. /// 默认值: (0);
  30. /// 描述: 是否使用;
  31. /// </summary>
  32. public const string cIsUse = "IsUse";
  33. /// <summary>
  34. /// 为关键字段: N ;
  35. /// 自动增长: N;
  36. /// 数据类型: varchar;
  37. /// 数据长度: 40;
  38. /// 是否允许为空: N;
  39. /// 默认值: ;
  40. /// 描述: 标准名称;
  41. /// </summary>
  42. public const string cNames = "Names";
  43. /// <summary>
  44. /// 为关键字段: N ;
  45. /// 自动增长: N;
  46. /// 数据类型: numeric;
  47. /// 数据长度: 5;
  48. /// 是否允许为空: N;
  49. /// 默认值: ;
  50. /// 描述: 超标限值;
  51. /// </summary>
  52. public const string cOvertopValue = "OvertopValue";
  53. /// <summary>
  54. /// 为关键字段: N ;
  55. /// 自动增长: N;
  56. /// 数据类型: numeric;
  57. /// 数据长度: 5;
  58. /// 是否允许为空: N;
  59. /// 默认值: ;
  60. /// 描述: 合格限值;
  61. /// </summary>
  62. public const string cRegularValue = "RegularValue";
  63. /// <summary>
  64. /// 为关键字段: Y --- PrimaryKey;
  65. /// 自动增长: Y;
  66. /// 数据类型: int;
  67. /// 数据长度: 4;
  68. /// 是否允许为空: N;
  69. /// 默认值: ;
  70. /// 描述: 编号;
  71. /// </summary>
  72. public const string cStandardID = "StandardID";
  73. #endregion
  74. public Standard_info() { }
  75. public Standard_info(DataRow poRow)
  76. {
  77. CreateTableInfo(poRow);
  78. }
  79. public void CreateTableInfo(DataRow poRow)
  80. {
  81. _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
  82. _IsUse = UtilStr.StrFromObj(poRow[cIsUse]);
  83. _Names = UtilStr.StrFromObj(poRow[cNames]);
  84. _OvertopValue = UtilStr.StrFromObj(poRow[cOvertopValue]);
  85. _RegularValue = UtilStr.StrFromObj(poRow[cRegularValue]);
  86. _StandardID = UtilStr.StrFromObj(poRow[cStandardID]);
  87. }
  88. public Standard_info(string pcStandardID, DBConnSql poDBConn)
  89. {
  90. if (pcStandardID.Trim().Length > 0 && poDBConn != null)
  91. {
  92. string lcSql = "select * from " + Tn.Standard + " where StandardID='" + pcStandardID + "'";
  93. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  94. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
  95. {
  96. loQuery.MoveFirst();
  97. CreateTableInfo(loQuery.CurrentRow);
  98. }
  99. }
  100. }
  101. private string _IsLock = "";
  102. public string IsLock
  103. {
  104. get
  105. {
  106. return _IsLock;
  107. }
  108. set { _IsLock = value; }
  109. }
  110. private string _IsUse = "";
  111. public string IsUse
  112. {
  113. get { return _IsUse; }
  114. set { _IsUse = value; }
  115. }
  116. private string _Names = "";
  117. public string Names
  118. {
  119. get { return _Names; }
  120. set { _Names = value; }
  121. }
  122. private string _OvertopValue = "";
  123. public string OvertopValue
  124. {
  125. get { return _OvertopValue; }
  126. set { _OvertopValue = value; }
  127. }
  128. private string _RegularValue = "";
  129. public string RegularValue
  130. {
  131. get { return _RegularValue; }
  132. set { _RegularValue = value; }
  133. }
  134. private string _StandardID = "";
  135. public string StandardID
  136. {
  137. get { return _StandardID; }
  138. set { _StandardID = value; }
  139. }
  140. [ScriptIgnore]
  141. public rsXmlNode DataXMLNode
  142. {
  143. get
  144. {
  145. rsXmlNode loMainNode = new rsXmlNode("StandardRecord", "");
  146. rsXmlNode loNode = null;
  147. loNode = new rsXmlNode(cIsLock, IsLock);
  148. loMainNode.AddChild(loNode);
  149. loNode = new rsXmlNode(cIsUse, IsUse);
  150. loMainNode.AddChild(loNode);
  151. loNode = new rsXmlNode(cNames, Names);
  152. loMainNode.AddChild(loNode);
  153. loNode = new rsXmlNode(cOvertopValue, OvertopValue);
  154. loMainNode.AddChild(loNode);
  155. loNode = new rsXmlNode(cRegularValue, RegularValue);
  156. loMainNode.AddChild(loNode);
  157. loNode = new rsXmlNode(cStandardID, StandardID);
  158. loMainNode.AddChild(loNode);
  159. return loMainNode;
  160. }
  161. }
  162. public string InsertSql()
  163. {
  164. return " insert into " + Tn.Standard + " " +
  165. " (" + cIsLock + "," + cIsUse + "," + cNames + "," + cOvertopValue + "," + cRegularValue + ") " +
  166. " values (" + _IsLock + "," + _IsUse + ",'" + _Names + "','" + _OvertopValue + "','" + _RegularValue + "') ";
  167. }
  168. public string UpdateSql()
  169. {
  170. return " update " + Tn.Standard + " " +
  171. " set " + cIsLock + "=" + _IsLock + "," + cIsUse + "=" + _IsUse + "," + cNames + "='" + _Names + "'," + cOvertopValue + "='" + _OvertopValue + "'," + cRegularValue + "='" + _RegularValue + "' " +
  172. " where " + cStandardID + "=" + _StandardID + "";
  173. }
  174. public string DeleteSql()
  175. {
  176. return "Delete " + Tn.Standard + " where " + cStandardID + "=" + _StandardID + "";
  177. }
  178. }
  179. #endregion
  180. #region
  181. public class Standard_Qry : rsQuery
  182. {
  183. public Int64 IsLock
  184. {
  185. get { return GetInt(Standard_info.cIsLock); }
  186. // set { SetField(Standard_info.cIsLock, value); }
  187. }
  188. public Int64 IsUse
  189. {
  190. get { return GetInt(Standard_info.cIsUse); }
  191. // set { SetField(Standard_info.cIsUse, value); }
  192. }
  193. public String Names
  194. {
  195. get { return GetString(Standard_info.cNames); }
  196. // set { SetField(Standard_info.cNames, value); }
  197. }
  198. public Decimal OvertopValue
  199. {
  200. get { return GetDecimal(Standard_info.cOvertopValue); }
  201. // set { SetField(Standard_info.cOvertopValue, value); }
  202. }
  203. public Decimal RegularValue
  204. {
  205. get { return GetDecimal(Standard_info.cRegularValue); }
  206. // set { SetField(Standard_info.cRegularValue, value); }
  207. }
  208. public Int64 StandardID
  209. {
  210. get { return GetInt(Standard_info.cStandardID); }
  211. // set { SetField(Standard_info.cStandardID, value); }
  212. }
  213. }
  214. #endregion
  215. }