EvaluationItem_info.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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 EvaluationItem
  10. public class EvaluationItem_info : ITableInfo
  11. {
  12. #region EvaluationItem表 字段信息
  13. /// <summary>
  14. /// 为关键字段: N ;
  15. /// 自动增长: N;
  16. /// 数据类型: int;
  17. /// 数据长度: 4;
  18. /// 是否允许为空: N;
  19. /// 默认值: ;
  20. /// 描述: EvaluationID;
  21. /// </summary>
  22. public const string cEvaluationID = "EvaluationID";
  23. /// <summary>
  24. /// 为关键字段: Y --- PrimaryKey;
  25. /// 自动增长: Y;
  26. /// 数据类型: int;
  27. /// 数据长度: 4;
  28. /// 是否允许为空: N;
  29. /// 默认值: ;
  30. /// 描述: EvaluationItemID;
  31. /// </summary>
  32. public const string cEvaluationItemID = "EvaluationItemID";
  33. /// <summary>
  34. /// 为关键字段: N ;
  35. /// 自动增长: N;
  36. /// 数据类型: nvarchar;
  37. /// 数据长度: -1;
  38. /// 是否允许为空: Y;
  39. /// 默认值: ;
  40. /// 描述: EvaluationNorm;
  41. /// </summary>
  42. public const string cEvaluationNorm = "EvaluationNorm";
  43. /// <summary>
  44. /// 为关键字段: N ;
  45. /// 自动增长: N;
  46. /// 数据类型: nchar;
  47. /// 数据长度: 2;
  48. /// 是否允许为空: N;
  49. /// 默认值: (N'N');
  50. /// 描述: IsLock;
  51. /// </summary>
  52. public const string cIsLock = "IsLock";
  53. /// <summary>
  54. /// 为关键字段: N ;
  55. /// 自动增长: N;
  56. /// 数据类型: varchar;
  57. /// 数据长度: -1;
  58. /// 是否允许为空: N;
  59. /// 默认值: ;
  60. /// 描述: ItemContent;
  61. /// </summary>
  62. public const string cItemContent = "ItemContent";
  63. /// <summary>
  64. /// 为关键字段: N ;
  65. /// 自动增长: N;
  66. /// 数据类型: smallint;
  67. /// 数据长度: 2;
  68. /// 是否允许为空: N;
  69. /// 默认值: ;
  70. /// 描述: ItemIndex;
  71. /// </summary>
  72. public const string cItemIndex = "ItemIndex";
  73. /// <summary>
  74. /// 为关键字段: N ;
  75. /// 自动增长: N;
  76. /// 数据类型: smallint;
  77. /// 数据长度: 2;
  78. /// 是否允许为空: N;
  79. /// 默认值: ;
  80. /// 描述: Score;
  81. /// </summary>
  82. public const string cScore = "Score";
  83. /// <summary>
  84. /// 为关键字段: N ;
  85. /// 自动增长: N;
  86. /// 数据类型: smalldatetime;
  87. /// 数据长度: 4;
  88. /// 是否允许为空: N;
  89. /// 默认值: ;
  90. /// 描述: TimeCreated;
  91. /// </summary>
  92. public const string cTimeCreated = "TimeCreated";
  93. /// <summary>
  94. /// 为关键字段: N ;
  95. /// 自动增长: N;
  96. /// 数据类型: smalldatetime;
  97. /// 数据长度: 4;
  98. /// 是否允许为空: N;
  99. /// 默认值: ;
  100. /// 描述: TimeLastMod;
  101. /// </summary>
  102. public const string cTimeLastMod = "TimeLastMod";
  103. /// <summary>
  104. /// 为关键字段: N ;
  105. /// 自动增长: N;
  106. /// 数据类型: varchar;
  107. /// 数据长度: 30;
  108. /// 是否允许为空: N;
  109. /// 默认值: ;
  110. /// 描述: UserIDLastMod;
  111. /// </summary>
  112. public const string cUserIDLastMod = "UserIDLastMod";
  113. #endregion
  114. public EvaluationItem_info() { }
  115. public EvaluationItem_info(DataRow poRow)
  116. {
  117. CreateTableInfo(poRow);
  118. }
  119. public void CreateTableInfo(DataRow poRow)
  120. {
  121. _EvaluationID = UtilStr.StrFromObj(poRow[cEvaluationID]);
  122. _EvaluationItemID = UtilStr.StrFromObj(poRow[cEvaluationItemID]);
  123. _EvaluationNorm = UtilStr.StrFromObj(poRow[cEvaluationNorm]);
  124. _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
  125. _ItemContent = UtilStr.StrFromObj(poRow[cItemContent]);
  126. _ItemIndex = UtilStr.StrFromObj(poRow[cItemIndex]);
  127. _Score = UtilStr.StrFromObj(poRow[cScore]);
  128. _TimeCreated = UtilStr.StrFromObj(poRow[cTimeCreated]);
  129. _TimeLastMod = UtilStr.StrFromObj(poRow[cTimeLastMod]);
  130. _UserIDLastMod = UtilStr.StrFromObj(poRow[cUserIDLastMod]);
  131. }
  132. public EvaluationItem_info(string pcEvaluationItemID, DBConnSql poDBConn)
  133. {
  134. if (pcEvaluationItemID.Trim().Length > 0 && poDBConn != null)
  135. {
  136. string lcSql = "select * from " + Tn.EvaluationItem + " where EvaluationItemID='" + pcEvaluationItemID + "'";
  137. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  138. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
  139. {
  140. loQuery.MoveFirst();
  141. CreateTableInfo(loQuery.CurrentRow);
  142. }
  143. }
  144. }
  145. private string _EvaluationID = "";
  146. public string EvaluationID
  147. {
  148. get { return _EvaluationID; }
  149. set { _EvaluationID = value; }
  150. }
  151. private string _EvaluationItemID = "";
  152. public string EvaluationItemID
  153. {
  154. get { return _EvaluationItemID; }
  155. set { _EvaluationItemID = value; }
  156. }
  157. private string _EvaluationNorm = "";
  158. public string EvaluationNorm
  159. {
  160. get { return _EvaluationNorm; }
  161. set { _EvaluationNorm = value; }
  162. }
  163. private string _IsLock = "";
  164. public string IsLock
  165. {
  166. get { return _IsLock; }
  167. set { _IsLock = value; }
  168. }
  169. private string _ItemContent = "";
  170. public string ItemContent
  171. {
  172. get { return _ItemContent; }
  173. set { _ItemContent = value; }
  174. }
  175. private string _ItemIndex = "";
  176. public string ItemIndex
  177. {
  178. get { return _ItemIndex; }
  179. set { _ItemIndex = value; }
  180. }
  181. private string _Score = "";
  182. public string Score
  183. {
  184. get { return _Score; }
  185. set { _Score = value; }
  186. }
  187. private string _TimeCreated = "";
  188. public string TimeCreated
  189. {
  190. get { return _TimeCreated; }
  191. set { _TimeCreated = value; }
  192. }
  193. private string _TimeLastMod = "";
  194. public string TimeLastMod
  195. {
  196. get { return _TimeLastMod; }
  197. set { _TimeLastMod = value; }
  198. }
  199. private string _UserIDLastMod = "";
  200. public string UserIDLastMod
  201. {
  202. get { return _UserIDLastMod; }
  203. set { _UserIDLastMod = value; }
  204. }
  205. [ScriptIgnore]
  206. public rsXmlNode DataXMLNode
  207. {
  208. get
  209. {
  210. rsXmlNode loMainNode = new rsXmlNode("EvaluationItemRecord", "");
  211. rsXmlNode loNode = null;
  212. loNode = new rsXmlNode(cEvaluationID, EvaluationID);
  213. loMainNode.AddChild(loNode);
  214. loNode = new rsXmlNode(cEvaluationItemID, EvaluationItemID);
  215. loMainNode.AddChild(loNode);
  216. loNode = new rsXmlNode(cEvaluationNorm, EvaluationNorm);
  217. loMainNode.AddChild(loNode);
  218. loNode = new rsXmlNode(cIsLock, IsLock);
  219. loMainNode.AddChild(loNode);
  220. loNode = new rsXmlNode(cItemContent, ItemContent);
  221. loMainNode.AddChild(loNode);
  222. loNode = new rsXmlNode(cItemIndex, ItemIndex);
  223. loMainNode.AddChild(loNode);
  224. loNode = new rsXmlNode(cScore, Score);
  225. loMainNode.AddChild(loNode);
  226. loNode = new rsXmlNode(cTimeCreated, TimeCreated);
  227. loMainNode.AddChild(loNode);
  228. loNode = new rsXmlNode(cTimeLastMod, TimeLastMod);
  229. loMainNode.AddChild(loNode);
  230. loNode = new rsXmlNode(cUserIDLastMod, UserIDLastMod);
  231. loMainNode.AddChild(loNode);
  232. return loMainNode;
  233. }
  234. }
  235. public string InsertSql()
  236. {
  237. return " insert into " + Tn.EvaluationItem + " " +
  238. " (" + cEvaluationID + "," + cEvaluationNorm + "," + cIsLock + "," + cItemContent + "," + cItemIndex + "," + cScore + "," + cTimeCreated + "," + cTimeLastMod + "," + cUserIDLastMod + ") " +
  239. " values (" + _EvaluationID + ",'" + _EvaluationNorm + "','" + _IsLock + "','" + _ItemContent + "','" + _ItemIndex + "','" + _Score + "','" + _TimeCreated + "','" + _TimeLastMod + "','" + _UserIDLastMod + "') ";
  240. }
  241. public string UpdateSql()
  242. {
  243. return " update " + Tn.EvaluationItem + " " +
  244. " set " + cEvaluationID + "=" + _EvaluationID + "," + cEvaluationNorm + "='" + _EvaluationNorm + "'," + cIsLock + "='" + _IsLock + "'," + cItemContent + "='" + _ItemContent + "'," + cItemIndex + "='" + _ItemIndex + "'," + cScore + "='" + _Score + "'," + cTimeCreated + "='" + _TimeCreated + "'," + cTimeLastMod + "='" + _TimeLastMod + "'," + cUserIDLastMod + "='" + _UserIDLastMod + "' " +
  245. " where " + cEvaluationItemID + "=" + _EvaluationItemID + "";
  246. }
  247. public string DeleteSql()
  248. {
  249. return "Delete " + Tn.EvaluationItem + " where " + cEvaluationItemID + "=" + _EvaluationItemID + "";
  250. }
  251. public static bool update(string pcDeleteLine, string pcType, DBConnSql poDBCon)
  252. {
  253. string lcSql = "update " + Tn.EvaluationItem + " set " + cIsLock + " ='" + pcType + "' where " + cEvaluationItemID + " in(" + pcDeleteLine + ")";
  254. if (!poDBCon.ExcuteSqlTran(lcSql))
  255. {
  256. JSComm.ShowMessage("操作失败!");
  257. }
  258. return true;
  259. }
  260. }
  261. #endregion
  262. #region
  263. public class EvaluationItem_Qry : rsQuery
  264. {
  265. public Int64 EvaluationID
  266. {
  267. get { return GetInt(EvaluationItem_info.cEvaluationID); }
  268. // set { SetField(EvaluationItem_info.cEvaluationID, value); }
  269. }
  270. public Int64 EvaluationItemID
  271. {
  272. get { return GetInt(EvaluationItem_info.cEvaluationItemID); }
  273. // set { SetField(EvaluationItem_info.cEvaluationItemID, value); }
  274. }
  275. public String EvaluationNorm
  276. {
  277. get { return GetString(EvaluationItem_info.cEvaluationNorm); }
  278. // set { SetField(EvaluationItem_info.cEvaluationNorm, value); }
  279. }
  280. public Boolean IsLock
  281. {
  282. get { return GetBool(EvaluationItem_info.cIsLock); }
  283. // set { SetField(EvaluationItem_info.cIsLock, value); }
  284. }
  285. public String ItemContent
  286. {
  287. get { return GetString(EvaluationItem_info.cItemContent); }
  288. // set { SetField(EvaluationItem_info.cItemContent, value); }
  289. }
  290. public Int64 ItemIndex
  291. {
  292. get { return GetInt(EvaluationItem_info.cItemIndex); }
  293. // set { SetField(EvaluationItem_info.cItemIndex, value); }
  294. }
  295. public Int64 Score
  296. {
  297. get { return GetInt(EvaluationItem_info.cScore); }
  298. // set { SetField(EvaluationItem_info.cScore, value); }
  299. }
  300. public DateTime TimeCreated
  301. {
  302. get { return GetDateTime(EvaluationItem_info.cTimeCreated); }
  303. // set { SetField(EvaluationItem_info.cTimeCreated, value); }
  304. }
  305. public DateTime TimeLastMod
  306. {
  307. get { return GetDateTime(EvaluationItem_info.cTimeLastMod); }
  308. // set { SetField(EvaluationItem_info.cTimeLastMod, value); }
  309. }
  310. public String UserIDLastMod
  311. {
  312. get { return GetString(EvaluationItem_info.cUserIDLastMod); }
  313. // set { SetField(EvaluationItem_info.cUserIDLastMod, value); }
  314. }
  315. }
  316. #endregion
  317. }