Evaluation_info.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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 Evaluation
  10. public class Evaluation_info : ITableInfo
  11. {
  12. #region Evaluation表 字段信息
  13. /// <summary>
  14. /// 为关键字段: N ;
  15. /// 自动增长: N;
  16. /// 数据类型: smalldatetime;
  17. /// 数据长度: 4;
  18. /// 是否允许为空: Y;
  19. /// 默认值: ;
  20. /// 描述: 考评标准制定时间;
  21. /// </summary>
  22. public const string cEvaluationCreateTime = "EvaluationCreateTime";
  23. /// <summary>
  24. /// 为关键字段: N ;
  25. /// 自动增长: N;
  26. /// 数据类型: varchar;
  27. /// 数据长度: -1;
  28. /// 是否允许为空: Y;
  29. /// 默认值: ;
  30. /// 描述: 考评说明;
  31. /// </summary>
  32. public const string cEvaluationDesc = "EvaluationDesc";
  33. /// <summary>
  34. /// 为关键字段: Y --- PrimaryKey;
  35. /// 自动增长: Y;
  36. /// 数据类型: int;
  37. /// 数据长度: 4;
  38. /// 是否允许为空: N;
  39. /// 默认值: ;
  40. /// 描述: EvaluationID;
  41. /// </summary>
  42. public const string cEvaluationID = "EvaluationID";
  43. /// <summary>
  44. /// 为关键字段: N ;
  45. /// 自动增长: N;
  46. /// 数据类型: nvarchar;
  47. /// 数据长度: 100;
  48. /// 是否允许为空: N;
  49. /// 默认值: ;
  50. /// 描述: 考评标准名;
  51. /// </summary>
  52. public const string cEvaluationName = "EvaluationName";
  53. /// <summary>
  54. /// 为关键字段: N ;
  55. /// 自动增长: N;
  56. /// 数据类型: nvarchar;
  57. /// 数据长度: 300;
  58. /// 是否允许为空: Y;
  59. /// 默认值: ;
  60. /// 描述: 考评标准发布组织;
  61. /// </summary>
  62. public const string cEvaluationOrg = "EvaluationOrg";
  63. /// <summary>
  64. /// 为关键字段: N ;
  65. /// 自动增长: N;
  66. /// 数据类型: nchar;
  67. /// 数据长度: 2;
  68. /// 是否允许为空: N;
  69. /// 默认值: ;
  70. /// 描述: 考评类型(M 市场类,S 摊贩类);
  71. /// </summary>
  72. public const string cEvaluationType = "EvaluationType";
  73. /// <summary>
  74. /// 为关键字段: N ;
  75. /// 自动增长: N;
  76. /// 数据类型: nchar;
  77. /// 数据长度: 2;
  78. /// 是否允许为空: N;
  79. /// 默认值: (N'N');
  80. /// 描述: IsLock;
  81. /// </summary>
  82. public const string cIsLock = "IsLock";
  83. /// <summary>
  84. /// 为关键字段: N ;
  85. /// 自动增长: N;
  86. /// 数据类型: nchar;
  87. /// 数据长度: 2;
  88. /// 是否允许为空: Y;
  89. /// 默认值: ;
  90. /// 描述: 是否正在使用中;
  91. /// </summary>
  92. public const string cIsUser = "IsUser";
  93. /// <summary>
  94. /// 为关键字段: N ;
  95. /// 自动增长: N;
  96. /// 数据类型: smalldatetime;
  97. /// 数据长度: 4;
  98. /// 是否允许为空: N;
  99. /// 默认值: (getdate());
  100. /// 描述: TimeCreated;
  101. /// </summary>
  102. public const string cTimeCreated = "TimeCreated";
  103. /// <summary>
  104. /// 为关键字段: N ;
  105. /// 自动增长: N;
  106. /// 数据类型: smalldatetime;
  107. /// 数据长度: 4;
  108. /// 是否允许为空: N;
  109. /// 默认值: (getdate());
  110. /// 描述: TimeLastMod;
  111. /// </summary>
  112. public const string cTimeLastMod = "TimeLastMod";
  113. /// <summary>
  114. /// 为关键字段: N ;
  115. /// 自动增长: N;
  116. /// 数据类型: varchar;
  117. /// 数据长度: 30;
  118. /// 是否允许为空: N;
  119. /// 默认值: ;
  120. /// 描述: UserIDLastMod;
  121. /// </summary>
  122. public const string cUserIDLastMod = "UserIDLastMod";
  123. #endregion
  124. public Evaluation_info() { }
  125. public Evaluation_info(DataRow poRow)
  126. {
  127. CreateTableInfo(poRow);
  128. }
  129. public void CreateTableInfo(DataRow poRow)
  130. {
  131. _EvaluationCreateTime = UtilStr.StrFromObj(poRow[cEvaluationCreateTime]);
  132. _EvaluationDesc = UtilStr.StrFromObj(poRow[cEvaluationDesc]);
  133. _EvaluationID = UtilStr.StrFromObj(poRow[cEvaluationID]);
  134. _EvaluationName = UtilStr.StrFromObj(poRow[cEvaluationName]);
  135. _EvaluationOrg = UtilStr.StrFromObj(poRow[cEvaluationOrg]);
  136. _EvaluationType = UtilStr.StrFromObj(poRow[cEvaluationType]);
  137. _IsLock = UtilStr.StrFromObj(poRow[cIsLock]);
  138. _IsUser = UtilStr.StrFromObj(poRow[cIsUser]);
  139. _TimeCreated = UtilStr.StrFromObj(poRow[cTimeCreated]);
  140. _TimeLastMod = UtilStr.StrFromObj(poRow[cTimeLastMod]);
  141. _UserIDLastMod = UtilStr.StrFromObj(poRow[cUserIDLastMod]);
  142. }
  143. public Evaluation_info(string pcEvaluationID, DBConnSql poDBConn)
  144. {
  145. if (pcEvaluationID.Trim().Length > 0 && poDBConn != null)
  146. {
  147. string lcSql = "select * from " + Tn.Evaluation + " where EvaluationID='" + pcEvaluationID + "'";
  148. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  149. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
  150. {
  151. loQuery.MoveFirst();
  152. CreateTableInfo(loQuery.CurrentRow);
  153. }
  154. }
  155. }
  156. public Evaluation_info(string pcType, bool IsUser, DBConnSql poDBConn)
  157. {
  158. string lcSql = "select * from " + Tn.Evaluation + " where " + Evaluation_info.cIsUser + "='" + (IsUser ? "Y" : "N") + "' and " + Evaluation_info.cEvaluationType + "='" + pcType + "' and " + Evaluation_info.cIsLock + "='N' ";
  159. rsQuery loQuery = poDBConn.OpenQuery(lcSql);
  160. if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
  161. {
  162. loQuery.MoveFirst();
  163. CreateTableInfo(loQuery.CurrentRow);
  164. }
  165. }
  166. private string _EvaluationCreateTime = "";
  167. public string EvaluationCreateTime
  168. {
  169. get { return _EvaluationCreateTime; }
  170. set { _EvaluationCreateTime = value; }
  171. }
  172. private string _EvaluationDesc = "";
  173. public string EvaluationDesc
  174. {
  175. get { return _EvaluationDesc; }
  176. set { _EvaluationDesc = value; }
  177. }
  178. private string _EvaluationID = "";
  179. public string EvaluationID
  180. {
  181. get { return _EvaluationID; }
  182. set { _EvaluationID = value; }
  183. }
  184. private string _EvaluationName = "";
  185. public string EvaluationName
  186. {
  187. get { return _EvaluationName; }
  188. set { _EvaluationName = value; }
  189. }
  190. private string _EvaluationOrg = "";
  191. public string EvaluationOrg
  192. {
  193. get { return _EvaluationOrg; }
  194. set { _EvaluationOrg = value; }
  195. }
  196. private string _EvaluationType = "";
  197. public string EvaluationType
  198. {
  199. get { return _EvaluationType; }
  200. set { _EvaluationType = value; }
  201. }
  202. private string _IsLock = "";
  203. public string IsLock
  204. {
  205. get { return _IsLock; }
  206. set { _IsLock = value; }
  207. }
  208. private string _IsUser = "";
  209. public string IsUser
  210. {
  211. get { return _IsUser; }
  212. set { _IsUser = value; }
  213. }
  214. private string _TimeCreated = "";
  215. public string TimeCreated
  216. {
  217. get { return _TimeCreated; }
  218. set { _TimeCreated = value; }
  219. }
  220. private string _TimeLastMod = "";
  221. public string TimeLastMod
  222. {
  223. get { return _TimeLastMod; }
  224. set { _TimeLastMod = value; }
  225. }
  226. private string _UserIDLastMod = "";
  227. public string UserIDLastMod
  228. {
  229. get { return _UserIDLastMod; }
  230. set { _UserIDLastMod = value; }
  231. }
  232. EvaluationItem_Qry _CurEvaluationItems;
  233. public EvaluationItem_Qry CurEvaluationItems
  234. {
  235. get
  236. {
  237. if (!(_CurEvaluationItems != null && _CurEvaluationItems.IsOpened))
  238. {
  239. UserSession loSession = WebLibs.CheckLogin();
  240. _CurEvaluationItems = new EvaluationItem_Qry();
  241. _CurEvaluationItems.Open("select * from " + Tn.EvaluationItem + " where " + EvaluationItem_info.cEvaluationID + "='" + this.EvaluationID + "' and " + cIsLock + "='N' order by ItemIndex ", loSession.DBConn);
  242. }
  243. return _CurEvaluationItems;
  244. }
  245. }
  246. [ScriptIgnore]
  247. public rsXmlNode DataXMLNode
  248. {
  249. get
  250. {
  251. rsXmlNode loMainNode = new rsXmlNode("EvaluationRecord", "");
  252. rsXmlNode loNode = null;
  253. loNode = new rsXmlNode(cEvaluationCreateTime, EvaluationCreateTime);
  254. loMainNode.AddChild(loNode);
  255. loNode = new rsXmlNode(cEvaluationDesc, EvaluationDesc);
  256. loMainNode.AddChild(loNode);
  257. loNode = new rsXmlNode(cEvaluationID, EvaluationID);
  258. loMainNode.AddChild(loNode);
  259. loNode = new rsXmlNode(cEvaluationName, EvaluationName);
  260. loMainNode.AddChild(loNode);
  261. loNode = new rsXmlNode(cEvaluationOrg, EvaluationOrg);
  262. loMainNode.AddChild(loNode);
  263. loNode = new rsXmlNode(cEvaluationType, EvaluationType);
  264. loMainNode.AddChild(loNode);
  265. loNode = new rsXmlNode(cIsLock, IsLock);
  266. loMainNode.AddChild(loNode);
  267. loNode = new rsXmlNode(cIsUser, IsUser);
  268. loMainNode.AddChild(loNode);
  269. loNode = new rsXmlNode(cTimeCreated, TimeCreated);
  270. loMainNode.AddChild(loNode);
  271. loNode = new rsXmlNode(cTimeLastMod, TimeLastMod);
  272. loMainNode.AddChild(loNode);
  273. loNode = new rsXmlNode(cUserIDLastMod, UserIDLastMod);
  274. loMainNode.AddChild(loNode);
  275. return loMainNode;
  276. }
  277. }
  278. public string InsertSql()
  279. {
  280. return " insert into " + Tn.Evaluation + " " +
  281. " (" + cEvaluationCreateTime + "," + cEvaluationDesc + "," + cEvaluationName + "," + cEvaluationOrg + "," + cEvaluationType + "," + cIsLock + "," + cIsUser + "," + cTimeCreated + "," + cTimeLastMod + "," + cUserIDLastMod + ") " +
  282. " values ('" + _EvaluationCreateTime + "','" + _EvaluationDesc + "','" + _EvaluationName + "','" + _EvaluationOrg + "','" + _EvaluationType + "','" + _IsLock + "','" + _IsUser + "','" + _TimeCreated + "','" + _TimeLastMod + "','" + _UserIDLastMod + "') ";
  283. }
  284. public string UpdateSql()
  285. {
  286. return " update " + Tn.Evaluation + " " +
  287. " set " + cEvaluationCreateTime + "='" + _EvaluationCreateTime + "'," + cEvaluationDesc + "='" + _EvaluationDesc + "'," + cEvaluationName + "='" + _EvaluationName + "'," + cEvaluationOrg + "='" + _EvaluationOrg + "'," + cEvaluationType + "='" + _EvaluationType + "'," + cIsLock + "='" + _IsLock + "'," + cIsUser + "='" + _IsUser + "'," + cTimeCreated + "='" + _TimeCreated + "'," + cTimeLastMod + "='" + _TimeLastMod + "'," + cUserIDLastMod + "='" + _UserIDLastMod + "' " +
  288. " where " + cEvaluationID + "=" + _EvaluationID + "";
  289. }
  290. public string DeleteSql()
  291. {
  292. return "Delete " + Tn.Evaluation + " where " + cEvaluationID + "=" + _EvaluationID + "";
  293. }
  294. public static bool update(string pcDeleteLine, string pcType ,DBConnSql poDBCon )
  295. {
  296. string lcSql = "update " + Tn.Evaluation + " set " + cIsLock + " ='" + pcType + "' where " + cEvaluationID + " in(" + pcDeleteLine + ")";
  297. if (!poDBCon.ExcuteSqlTran(lcSql))
  298. {
  299. JSComm.ShowMessage("操作失败!");
  300. }
  301. return true;
  302. }
  303. }
  304. #endregion
  305. #region
  306. public class Evaluation_Qry : rsQuery
  307. {
  308. public DateTime EvaluationCreateTime
  309. {
  310. get { return GetDateTime(Evaluation_info.cEvaluationCreateTime); }
  311. // set { SetField(Evaluation_info.cEvaluationCreateTime, value); }
  312. }
  313. public String EvaluationDesc
  314. {
  315. get { return GetString(Evaluation_info.cEvaluationDesc); }
  316. // set { SetField(Evaluation_info.cEvaluationDesc, value); }
  317. }
  318. public Int64 EvaluationID
  319. {
  320. get { return GetInt(Evaluation_info.cEvaluationID); }
  321. // set { SetField(Evaluation_info.cEvaluationID, value); }
  322. }
  323. public String EvaluationName
  324. {
  325. get { return GetString(Evaluation_info.cEvaluationName); }
  326. // set { SetField(Evaluation_info.cEvaluationName, value); }
  327. }
  328. public String EvaluationOrg
  329. {
  330. get { return GetString(Evaluation_info.cEvaluationOrg); }
  331. // set { SetField(Evaluation_info.cEvaluationOrg, value); }
  332. }
  333. public Boolean EvaluationType
  334. {
  335. get { return GetBool(Evaluation_info.cEvaluationType); }
  336. // set { SetField(Evaluation_info.cEvaluationType, value); }
  337. }
  338. public Boolean IsLock
  339. {
  340. get { return GetBool(Evaluation_info.cIsLock); }
  341. // set { SetField(Evaluation_info.cIsLock, value); }
  342. }
  343. public Boolean IsUser
  344. {
  345. get { return GetBool(Evaluation_info.cIsUser); }
  346. // set { SetField(Evaluation_info.cIsUser, value); }
  347. }
  348. public DateTime TimeCreated
  349. {
  350. get { return GetDateTime(Evaluation_info.cTimeCreated); }
  351. // set { SetField(Evaluation_info.cTimeCreated, value); }
  352. }
  353. public DateTime TimeLastMod
  354. {
  355. get { return GetDateTime(Evaluation_info.cTimeLastMod); }
  356. // set { SetField(Evaluation_info.cTimeLastMod, value); }
  357. }
  358. public String UserIDLastMod
  359. {
  360. get { return GetString(Evaluation_info.cUserIDLastMod); }
  361. // set { SetField(Evaluation_info.cUserIDLastMod, value); }
  362. }
  363. }
  364. #endregion
  365. }