地铁二期项目正式开始

T_Sys_TempItems.cs 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data.SqlClient;
  6. using System.Data;
  7. using YTSoft.DBUtility;
  8. namespace YTSoft.BaseCallCenter.DAL
  9. {
  10. /// <summary>
  11. /// 数据访问类:T_Sys_TempItems
  12. /// </summary>
  13. public partial class T_Sys_TempItems
  14. {
  15. public T_Sys_TempItems()
  16. { }
  17. #region Method
  18. /// <summary>
  19. /// 是否存在该记录
  20. /// </summary>
  21. public bool Exists(int F_Id)
  22. {
  23. StringBuilder strSql = new StringBuilder();
  24. strSql.Append("select count(1) from T_Sys_TempItems");
  25. strSql.Append(" where F_Id=@F_Id");
  26. SqlParameter[] parameters = {
  27. new SqlParameter("@F_Id", SqlDbType.Int,4)
  28. };
  29. parameters[0].Value = F_Id;
  30. return DbHelperSQL.Exists(strSql.ToString(), parameters);
  31. }
  32. /// <summary>
  33. /// 增加一条数据
  34. /// </summary>
  35. public int Add(YTSoft.BaseCallCenter.Model.T_Sys_TempItems model)
  36. {
  37. StringBuilder strSql = new StringBuilder();
  38. strSql.Append("insert into T_Sys_TempItems(");
  39. strSql.Append("F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5)");
  40. strSql.Append(" values (");
  41. strSql.Append("@F_TempName,@F_UserId,@ExpandIntField1,@ExpandIntField2,@ExpandIntField3,@ExpandIntField4,@ExpandIntField5,@ExpandIntField6,@ExpandDecField1,@ExpandDecField2,@ExpandDecField3,@ExpandDecField4,@ExpandDecField5,@ExpandDecField6,@ExpandDatField1,@ExpandDatField2,@ExpandDatField3,@ExpandDatField4,@ExpandDatField5,@ExpandDatField6,@ExpandVchField1,@ExpandVchField2,@ExpandVchField3,@ExpandVchField4,@ExpandVchField5,@ExpandVchField6,@ExpandVchField7,@ExpandVchField8,@ExpandVchField9,@ExpandVchField10,@ExpandVchField11,@ExpandVchField12,@ExpandVchField13,@ExpandVchField14,@ExpandVchField15,@ExpandSintField1,@ExpandSintField2,@ExpandSintField3,@ExpandSintField4,@ExpandSintField5)");
  42. strSql.Append(";select @@IDENTITY");
  43. SqlParameter[] parameters = {
  44. new SqlParameter("@F_TempName", SqlDbType.VarChar,200),
  45. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  46. new SqlParameter("@ExpandIntField1", SqlDbType.Int,4),
  47. new SqlParameter("@ExpandIntField2", SqlDbType.Int,4),
  48. new SqlParameter("@ExpandIntField3", SqlDbType.Int,4),
  49. new SqlParameter("@ExpandIntField4", SqlDbType.Int,4),
  50. new SqlParameter("@ExpandIntField5", SqlDbType.Int,4),
  51. new SqlParameter("@ExpandIntField6", SqlDbType.Int,4),
  52. new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9),
  53. new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9),
  54. new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9),
  55. new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9),
  56. new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9),
  57. new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9),
  58. new SqlParameter("@ExpandDatField1", SqlDbType.DateTime),
  59. new SqlParameter("@ExpandDatField2", SqlDbType.DateTime),
  60. new SqlParameter("@ExpandDatField3", SqlDbType.DateTime),
  61. new SqlParameter("@ExpandDatField4", SqlDbType.DateTime),
  62. new SqlParameter("@ExpandDatField5", SqlDbType.DateTime),
  63. new SqlParameter("@ExpandDatField6", SqlDbType.DateTime),
  64. new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200),
  65. new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200),
  66. new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200),
  67. new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200),
  68. new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200),
  69. new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200),
  70. new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200),
  71. new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200),
  72. new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200),
  73. new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500),
  74. new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500),
  75. new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000),
  76. new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000),
  77. new SqlParameter("@ExpandVchField14", SqlDbType.Text),
  78. new SqlParameter("@ExpandVchField15", SqlDbType.Text),
  79. new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2),
  80. new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2),
  81. new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2),
  82. new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2),
  83. new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2)};
  84. parameters[0].Value = model.F_TempName;
  85. parameters[1].Value = model.F_UserId;
  86. parameters[2].Value = model.ExpandIntField1;
  87. parameters[3].Value = model.ExpandIntField2;
  88. parameters[4].Value = model.ExpandIntField3;
  89. parameters[5].Value = model.ExpandIntField4;
  90. parameters[6].Value = model.ExpandIntField5;
  91. parameters[7].Value = model.ExpandIntField6;
  92. parameters[8].Value = model.ExpandDecField1;
  93. parameters[9].Value = model.ExpandDecField2;
  94. parameters[10].Value = model.ExpandDecField3;
  95. parameters[11].Value = model.ExpandDecField4;
  96. parameters[12].Value = model.ExpandDecField5;
  97. parameters[13].Value = model.ExpandDecField6;
  98. parameters[14].Value = model.ExpandDatField1;
  99. parameters[15].Value = model.ExpandDatField2;
  100. parameters[16].Value = model.ExpandDatField3;
  101. parameters[17].Value = model.ExpandDatField4;
  102. parameters[18].Value = model.ExpandDatField5;
  103. parameters[19].Value = model.ExpandDatField6;
  104. parameters[20].Value = model.ExpandVchField1;
  105. parameters[21].Value = model.ExpandVchField2;
  106. parameters[22].Value = model.ExpandVchField3;
  107. parameters[23].Value = model.ExpandVchField4;
  108. parameters[24].Value = model.ExpandVchField5;
  109. parameters[25].Value = model.ExpandVchField6;
  110. parameters[26].Value = model.ExpandVchField7;
  111. parameters[27].Value = model.ExpandVchField8;
  112. parameters[28].Value = model.ExpandVchField9;
  113. parameters[29].Value = model.ExpandVchField10;
  114. parameters[30].Value = model.ExpandVchField11;
  115. parameters[31].Value = model.ExpandVchField12;
  116. parameters[32].Value = model.ExpandVchField13;
  117. parameters[33].Value = model.ExpandVchField14;
  118. parameters[34].Value = model.ExpandVchField15;
  119. parameters[35].Value = model.ExpandSintField1;
  120. parameters[36].Value = model.ExpandSintField2;
  121. parameters[37].Value = model.ExpandSintField3;
  122. parameters[38].Value = model.ExpandSintField4;
  123. parameters[39].Value = model.ExpandSintField5;
  124. object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
  125. if (obj == null)
  126. {
  127. return 0;
  128. }
  129. else
  130. {
  131. return Convert.ToInt32(obj);
  132. }
  133. }
  134. /// <summary>
  135. /// 更新一条数据
  136. /// </summary>
  137. public bool Update(YTSoft.BaseCallCenter.Model.T_Sys_TempItems model)
  138. {
  139. StringBuilder strSql = new StringBuilder();
  140. strSql.Append("update T_Sys_TempItems set ");
  141. strSql.Append("F_TempName=@F_TempName,");
  142. strSql.Append("F_UserId=@F_UserId,");
  143. strSql.Append("ExpandIntField1=@ExpandIntField1,");
  144. strSql.Append("ExpandIntField2=@ExpandIntField2,");
  145. strSql.Append("ExpandIntField3=@ExpandIntField3,");
  146. strSql.Append("ExpandIntField4=@ExpandIntField4,");
  147. strSql.Append("ExpandIntField5=@ExpandIntField5,");
  148. strSql.Append("ExpandIntField6=@ExpandIntField6,");
  149. strSql.Append("ExpandDecField1=@ExpandDecField1,");
  150. strSql.Append("ExpandDecField2=@ExpandDecField2,");
  151. strSql.Append("ExpandDecField3=@ExpandDecField3,");
  152. strSql.Append("ExpandDecField4=@ExpandDecField4,");
  153. strSql.Append("ExpandDecField5=@ExpandDecField5,");
  154. strSql.Append("ExpandDecField6=@ExpandDecField6,");
  155. strSql.Append("ExpandDatField1=@ExpandDatField1,");
  156. strSql.Append("ExpandDatField2=@ExpandDatField2,");
  157. strSql.Append("ExpandDatField3=@ExpandDatField3,");
  158. strSql.Append("ExpandDatField4=@ExpandDatField4,");
  159. strSql.Append("ExpandDatField5=@ExpandDatField5,");
  160. strSql.Append("ExpandDatField6=@ExpandDatField6,");
  161. strSql.Append("ExpandVchField1=@ExpandVchField1,");
  162. strSql.Append("ExpandVchField2=@ExpandVchField2,");
  163. strSql.Append("ExpandVchField3=@ExpandVchField3,");
  164. strSql.Append("ExpandVchField4=@ExpandVchField4,");
  165. strSql.Append("ExpandVchField5=@ExpandVchField5,");
  166. strSql.Append("ExpandVchField6=@ExpandVchField6,");
  167. strSql.Append("ExpandVchField7=@ExpandVchField7,");
  168. strSql.Append("ExpandVchField8=@ExpandVchField8,");
  169. strSql.Append("ExpandVchField9=@ExpandVchField9,");
  170. strSql.Append("ExpandVchField10=@ExpandVchField10,");
  171. strSql.Append("ExpandVchField11=@ExpandVchField11,");
  172. strSql.Append("ExpandVchField12=@ExpandVchField12,");
  173. strSql.Append("ExpandVchField13=@ExpandVchField13,");
  174. strSql.Append("ExpandVchField14=@ExpandVchField14,");
  175. strSql.Append("ExpandVchField15=@ExpandVchField15,");
  176. strSql.Append("ExpandSintField1=@ExpandSintField1,");
  177. strSql.Append("ExpandSintField2=@ExpandSintField2,");
  178. strSql.Append("ExpandSintField3=@ExpandSintField3,");
  179. strSql.Append("ExpandSintField4=@ExpandSintField4,");
  180. strSql.Append("ExpandSintField5=@ExpandSintField5");
  181. strSql.Append(" where F_Id=@F_Id");
  182. SqlParameter[] parameters = {
  183. new SqlParameter("@F_TempName", SqlDbType.VarChar,200),
  184. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  185. new SqlParameter("@ExpandIntField1", SqlDbType.Int,4),
  186. new SqlParameter("@ExpandIntField2", SqlDbType.Int,4),
  187. new SqlParameter("@ExpandIntField3", SqlDbType.Int,4),
  188. new SqlParameter("@ExpandIntField4", SqlDbType.Int,4),
  189. new SqlParameter("@ExpandIntField5", SqlDbType.Int,4),
  190. new SqlParameter("@ExpandIntField6", SqlDbType.Int,4),
  191. new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9),
  192. new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9),
  193. new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9),
  194. new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9),
  195. new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9),
  196. new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9),
  197. new SqlParameter("@ExpandDatField1", SqlDbType.DateTime),
  198. new SqlParameter("@ExpandDatField2", SqlDbType.DateTime),
  199. new SqlParameter("@ExpandDatField3", SqlDbType.DateTime),
  200. new SqlParameter("@ExpandDatField4", SqlDbType.DateTime),
  201. new SqlParameter("@ExpandDatField5", SqlDbType.DateTime),
  202. new SqlParameter("@ExpandDatField6", SqlDbType.DateTime),
  203. new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200),
  204. new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200),
  205. new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200),
  206. new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200),
  207. new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200),
  208. new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200),
  209. new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200),
  210. new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200),
  211. new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200),
  212. new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500),
  213. new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500),
  214. new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000),
  215. new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000),
  216. new SqlParameter("@ExpandVchField14", SqlDbType.Text),
  217. new SqlParameter("@ExpandVchField15", SqlDbType.Text),
  218. new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2),
  219. new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2),
  220. new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2),
  221. new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2),
  222. new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2),
  223. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  224. parameters[0].Value = model.F_TempName;
  225. parameters[1].Value = model.F_UserId;
  226. parameters[2].Value = model.ExpandIntField1;
  227. parameters[3].Value = model.ExpandIntField2;
  228. parameters[4].Value = model.ExpandIntField3;
  229. parameters[5].Value = model.ExpandIntField4;
  230. parameters[6].Value = model.ExpandIntField5;
  231. parameters[7].Value = model.ExpandIntField6;
  232. parameters[8].Value = model.ExpandDecField1;
  233. parameters[9].Value = model.ExpandDecField2;
  234. parameters[10].Value = model.ExpandDecField3;
  235. parameters[11].Value = model.ExpandDecField4;
  236. parameters[12].Value = model.ExpandDecField5;
  237. parameters[13].Value = model.ExpandDecField6;
  238. parameters[14].Value = model.ExpandDatField1;
  239. parameters[15].Value = model.ExpandDatField2;
  240. parameters[16].Value = model.ExpandDatField3;
  241. parameters[17].Value = model.ExpandDatField4;
  242. parameters[18].Value = model.ExpandDatField5;
  243. parameters[19].Value = model.ExpandDatField6;
  244. parameters[20].Value = model.ExpandVchField1;
  245. parameters[21].Value = model.ExpandVchField2;
  246. parameters[22].Value = model.ExpandVchField3;
  247. parameters[23].Value = model.ExpandVchField4;
  248. parameters[24].Value = model.ExpandVchField5;
  249. parameters[25].Value = model.ExpandVchField6;
  250. parameters[26].Value = model.ExpandVchField7;
  251. parameters[27].Value = model.ExpandVchField8;
  252. parameters[28].Value = model.ExpandVchField9;
  253. parameters[29].Value = model.ExpandVchField10;
  254. parameters[30].Value = model.ExpandVchField11;
  255. parameters[31].Value = model.ExpandVchField12;
  256. parameters[32].Value = model.ExpandVchField13;
  257. parameters[33].Value = model.ExpandVchField14;
  258. parameters[34].Value = model.ExpandVchField15;
  259. parameters[35].Value = model.ExpandSintField1;
  260. parameters[36].Value = model.ExpandSintField2;
  261. parameters[37].Value = model.ExpandSintField3;
  262. parameters[38].Value = model.ExpandSintField4;
  263. parameters[39].Value = model.ExpandSintField5;
  264. parameters[40].Value = model.F_Id;
  265. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  266. if (rows > 0)
  267. {
  268. return true;
  269. }
  270. else
  271. {
  272. return false;
  273. }
  274. }
  275. /// <summary>
  276. /// 删除一条数据
  277. /// </summary>
  278. public bool Delete(int F_Id)
  279. {
  280. StringBuilder strSql = new StringBuilder();
  281. strSql.Append("delete from T_Sys_TempItems ");
  282. strSql.Append(" where F_Id=@F_Id");
  283. SqlParameter[] parameters = {
  284. new SqlParameter("@F_Id", SqlDbType.Int,4)
  285. };
  286. parameters[0].Value = F_Id;
  287. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  288. if (rows > 0)
  289. {
  290. return true;
  291. }
  292. else
  293. {
  294. return false;
  295. }
  296. }
  297. /// <summary>
  298. /// 批量删除数据
  299. /// </summary>
  300. public bool DeleteList(string F_Idlist)
  301. {
  302. StringBuilder strSql = new StringBuilder();
  303. strSql.Append("delete from T_Sys_TempItems ");
  304. strSql.Append(" where F_Id in (" + F_Idlist + ") ");
  305. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  306. if (rows > 0)
  307. {
  308. return true;
  309. }
  310. else
  311. {
  312. return false;
  313. }
  314. }
  315. /// <summary>
  316. /// 得到一个对象实体
  317. /// </summary>
  318. public YTSoft.BaseCallCenter.Model.T_Sys_TempItems GetModel(int F_Id)
  319. {
  320. StringBuilder strSql = new StringBuilder();
  321. strSql.Append("select top 1 F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 from T_Sys_TempItems ");
  322. strSql.Append(" where F_Id=@F_Id");
  323. SqlParameter[] parameters = {
  324. new SqlParameter("@F_Id", SqlDbType.Int,4)
  325. };
  326. parameters[0].Value = F_Id;
  327. YTSoft.BaseCallCenter.Model.T_Sys_TempItems model = new YTSoft.BaseCallCenter.Model.T_Sys_TempItems();
  328. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  329. if (ds.Tables[0].Rows.Count > 0)
  330. {
  331. if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "")
  332. {
  333. model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString());
  334. }
  335. if (ds.Tables[0].Rows[0]["F_TempName"] != null && ds.Tables[0].Rows[0]["F_TempName"].ToString() != "")
  336. {
  337. model.F_TempName = ds.Tables[0].Rows[0]["F_TempName"].ToString();
  338. }
  339. if (ds.Tables[0].Rows[0]["F_UserId"] != null && ds.Tables[0].Rows[0]["F_UserId"].ToString() != "")
  340. {
  341. model.F_UserId = int.Parse(ds.Tables[0].Rows[0]["F_UserId"].ToString());
  342. }
  343. if (ds.Tables[0].Rows[0]["ExpandIntField1"] != null && ds.Tables[0].Rows[0]["ExpandIntField1"].ToString() != "")
  344. {
  345. model.ExpandIntField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField1"].ToString());
  346. }
  347. if (ds.Tables[0].Rows[0]["ExpandIntField2"] != null && ds.Tables[0].Rows[0]["ExpandIntField2"].ToString() != "")
  348. {
  349. model.ExpandIntField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField2"].ToString());
  350. }
  351. if (ds.Tables[0].Rows[0]["ExpandIntField3"] != null && ds.Tables[0].Rows[0]["ExpandIntField3"].ToString() != "")
  352. {
  353. model.ExpandIntField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField3"].ToString());
  354. }
  355. if (ds.Tables[0].Rows[0]["ExpandIntField4"] != null && ds.Tables[0].Rows[0]["ExpandIntField4"].ToString() != "")
  356. {
  357. model.ExpandIntField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField4"].ToString());
  358. }
  359. if (ds.Tables[0].Rows[0]["ExpandIntField5"] != null && ds.Tables[0].Rows[0]["ExpandIntField5"].ToString() != "")
  360. {
  361. model.ExpandIntField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField5"].ToString());
  362. }
  363. if (ds.Tables[0].Rows[0]["ExpandIntField6"] != null && ds.Tables[0].Rows[0]["ExpandIntField6"].ToString() != "")
  364. {
  365. model.ExpandIntField6 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField6"].ToString());
  366. }
  367. if (ds.Tables[0].Rows[0]["ExpandDecField1"] != null && ds.Tables[0].Rows[0]["ExpandDecField1"].ToString() != "")
  368. {
  369. model.ExpandDecField1 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField1"].ToString());
  370. }
  371. if (ds.Tables[0].Rows[0]["ExpandDecField2"] != null && ds.Tables[0].Rows[0]["ExpandDecField2"].ToString() != "")
  372. {
  373. model.ExpandDecField2 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField2"].ToString());
  374. }
  375. if (ds.Tables[0].Rows[0]["ExpandDecField3"] != null && ds.Tables[0].Rows[0]["ExpandDecField3"].ToString() != "")
  376. {
  377. model.ExpandDecField3 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField3"].ToString());
  378. }
  379. if (ds.Tables[0].Rows[0]["ExpandDecField4"] != null && ds.Tables[0].Rows[0]["ExpandDecField4"].ToString() != "")
  380. {
  381. model.ExpandDecField4 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField4"].ToString());
  382. }
  383. if (ds.Tables[0].Rows[0]["ExpandDecField5"] != null && ds.Tables[0].Rows[0]["ExpandDecField5"].ToString() != "")
  384. {
  385. model.ExpandDecField5 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField5"].ToString());
  386. }
  387. if (ds.Tables[0].Rows[0]["ExpandDecField6"] != null && ds.Tables[0].Rows[0]["ExpandDecField6"].ToString() != "")
  388. {
  389. model.ExpandDecField6 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField6"].ToString());
  390. }
  391. if (ds.Tables[0].Rows[0]["ExpandDatField1"] != null && ds.Tables[0].Rows[0]["ExpandDatField1"].ToString() != "")
  392. {
  393. model.ExpandDatField1 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField1"].ToString());
  394. }
  395. if (ds.Tables[0].Rows[0]["ExpandDatField2"] != null && ds.Tables[0].Rows[0]["ExpandDatField2"].ToString() != "")
  396. {
  397. model.ExpandDatField2 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField2"].ToString());
  398. }
  399. if (ds.Tables[0].Rows[0]["ExpandDatField3"] != null && ds.Tables[0].Rows[0]["ExpandDatField3"].ToString() != "")
  400. {
  401. model.ExpandDatField3 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField3"].ToString());
  402. }
  403. if (ds.Tables[0].Rows[0]["ExpandDatField4"] != null && ds.Tables[0].Rows[0]["ExpandDatField4"].ToString() != "")
  404. {
  405. model.ExpandDatField4 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField4"].ToString());
  406. }
  407. if (ds.Tables[0].Rows[0]["ExpandDatField5"] != null && ds.Tables[0].Rows[0]["ExpandDatField5"].ToString() != "")
  408. {
  409. model.ExpandDatField5 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField5"].ToString());
  410. }
  411. if (ds.Tables[0].Rows[0]["ExpandDatField6"] != null && ds.Tables[0].Rows[0]["ExpandDatField6"].ToString() != "")
  412. {
  413. model.ExpandDatField6 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField6"].ToString());
  414. }
  415. if (ds.Tables[0].Rows[0]["ExpandVchField1"] != null && ds.Tables[0].Rows[0]["ExpandVchField1"].ToString() != "")
  416. {
  417. model.ExpandVchField1 = ds.Tables[0].Rows[0]["ExpandVchField1"].ToString();
  418. }
  419. if (ds.Tables[0].Rows[0]["ExpandVchField2"] != null && ds.Tables[0].Rows[0]["ExpandVchField2"].ToString() != "")
  420. {
  421. model.ExpandVchField2 = ds.Tables[0].Rows[0]["ExpandVchField2"].ToString();
  422. }
  423. if (ds.Tables[0].Rows[0]["ExpandVchField3"] != null && ds.Tables[0].Rows[0]["ExpandVchField3"].ToString() != "")
  424. {
  425. model.ExpandVchField3 = ds.Tables[0].Rows[0]["ExpandVchField3"].ToString();
  426. }
  427. if (ds.Tables[0].Rows[0]["ExpandVchField4"] != null && ds.Tables[0].Rows[0]["ExpandVchField4"].ToString() != "")
  428. {
  429. model.ExpandVchField4 = ds.Tables[0].Rows[0]["ExpandVchField4"].ToString();
  430. }
  431. if (ds.Tables[0].Rows[0]["ExpandVchField5"] != null && ds.Tables[0].Rows[0]["ExpandVchField5"].ToString() != "")
  432. {
  433. model.ExpandVchField5 = ds.Tables[0].Rows[0]["ExpandVchField5"].ToString();
  434. }
  435. if (ds.Tables[0].Rows[0]["ExpandVchField6"] != null && ds.Tables[0].Rows[0]["ExpandVchField6"].ToString() != "")
  436. {
  437. model.ExpandVchField6 = ds.Tables[0].Rows[0]["ExpandVchField6"].ToString();
  438. }
  439. if (ds.Tables[0].Rows[0]["ExpandVchField7"] != null && ds.Tables[0].Rows[0]["ExpandVchField7"].ToString() != "")
  440. {
  441. model.ExpandVchField7 = ds.Tables[0].Rows[0]["ExpandVchField7"].ToString();
  442. }
  443. if (ds.Tables[0].Rows[0]["ExpandVchField8"] != null && ds.Tables[0].Rows[0]["ExpandVchField8"].ToString() != "")
  444. {
  445. model.ExpandVchField8 = ds.Tables[0].Rows[0]["ExpandVchField8"].ToString();
  446. }
  447. if (ds.Tables[0].Rows[0]["ExpandVchField9"] != null && ds.Tables[0].Rows[0]["ExpandVchField9"].ToString() != "")
  448. {
  449. model.ExpandVchField9 = ds.Tables[0].Rows[0]["ExpandVchField9"].ToString();
  450. }
  451. if (ds.Tables[0].Rows[0]["ExpandVchField10"] != null && ds.Tables[0].Rows[0]["ExpandVchField10"].ToString() != "")
  452. {
  453. model.ExpandVchField10 = ds.Tables[0].Rows[0]["ExpandVchField10"].ToString();
  454. }
  455. if (ds.Tables[0].Rows[0]["ExpandVchField11"] != null && ds.Tables[0].Rows[0]["ExpandVchField11"].ToString() != "")
  456. {
  457. model.ExpandVchField11 = ds.Tables[0].Rows[0]["ExpandVchField11"].ToString();
  458. }
  459. if (ds.Tables[0].Rows[0]["ExpandVchField12"] != null && ds.Tables[0].Rows[0]["ExpandVchField12"].ToString() != "")
  460. {
  461. model.ExpandVchField12 = ds.Tables[0].Rows[0]["ExpandVchField12"].ToString();
  462. }
  463. if (ds.Tables[0].Rows[0]["ExpandVchField13"] != null && ds.Tables[0].Rows[0]["ExpandVchField13"].ToString() != "")
  464. {
  465. model.ExpandVchField13 = ds.Tables[0].Rows[0]["ExpandVchField13"].ToString();
  466. }
  467. if (ds.Tables[0].Rows[0]["ExpandVchField14"] != null && ds.Tables[0].Rows[0]["ExpandVchField14"].ToString() != "")
  468. {
  469. model.ExpandVchField14 = ds.Tables[0].Rows[0]["ExpandVchField14"].ToString();
  470. }
  471. if (ds.Tables[0].Rows[0]["ExpandVchField15"] != null && ds.Tables[0].Rows[0]["ExpandVchField15"].ToString() != "")
  472. {
  473. model.ExpandVchField15 = ds.Tables[0].Rows[0]["ExpandVchField15"].ToString();
  474. }
  475. if (ds.Tables[0].Rows[0]["ExpandSintField1"] != null && ds.Tables[0].Rows[0]["ExpandSintField1"].ToString() != "")
  476. {
  477. model.ExpandSintField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField1"].ToString());
  478. }
  479. if (ds.Tables[0].Rows[0]["ExpandSintField2"] != null && ds.Tables[0].Rows[0]["ExpandSintField2"].ToString() != "")
  480. {
  481. model.ExpandSintField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField2"].ToString());
  482. }
  483. if (ds.Tables[0].Rows[0]["ExpandSintField3"] != null && ds.Tables[0].Rows[0]["ExpandSintField3"].ToString() != "")
  484. {
  485. model.ExpandSintField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField3"].ToString());
  486. }
  487. if (ds.Tables[0].Rows[0]["ExpandSintField4"] != null && ds.Tables[0].Rows[0]["ExpandSintField4"].ToString() != "")
  488. {
  489. model.ExpandSintField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField4"].ToString());
  490. }
  491. if (ds.Tables[0].Rows[0]["ExpandSintField5"] != null && ds.Tables[0].Rows[0]["ExpandSintField5"].ToString() != "")
  492. {
  493. model.ExpandSintField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField5"].ToString());
  494. }
  495. return model;
  496. }
  497. else
  498. {
  499. return null;
  500. }
  501. }
  502. /// <summary>
  503. /// 获得数据列表
  504. /// </summary>
  505. public DataSet GetList(string strWhere)
  506. {
  507. StringBuilder strSql = new StringBuilder();
  508. strSql.Append("select F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 ");
  509. strSql.Append(" FROM T_Sys_TempItems ");
  510. if (strWhere.Trim() != "")
  511. {
  512. strSql.Append(" where " + strWhere);
  513. }
  514. return DbHelperSQL.Query(strSql.ToString());
  515. }
  516. /// <summary>
  517. /// 获得前几行数据
  518. /// </summary>
  519. public DataSet GetList(int Top, string strWhere, string filedOrder)
  520. {
  521. StringBuilder strSql = new StringBuilder();
  522. strSql.Append("select ");
  523. if (Top > 0)
  524. {
  525. strSql.Append(" top " + Top.ToString());
  526. }
  527. strSql.Append(" F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 ");
  528. strSql.Append(" FROM T_Sys_TempItems ");
  529. if (strWhere.Trim() != "")
  530. {
  531. strSql.Append(" where " + strWhere);
  532. }
  533. strSql.Append(" order by " + filedOrder);
  534. return DbHelperSQL.Query(strSql.ToString());
  535. }
  536. /// <summary>
  537. /// 获取记录总数
  538. /// </summary>
  539. public int GetRecordCount(string strWhere)
  540. {
  541. StringBuilder strSql = new StringBuilder();
  542. strSql.Append("select count(1) FROM T_Sys_TempItems ");
  543. if (strWhere.Trim() != "")
  544. {
  545. strSql.Append(" where " + strWhere);
  546. }
  547. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  548. if (obj == null)
  549. {
  550. return 0;
  551. }
  552. else
  553. {
  554. return Convert.ToInt32(obj);
  555. }
  556. }
  557. /// <summary>
  558. /// 分页获取数据列表
  559. /// </summary>
  560. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  561. {
  562. StringBuilder strSql = new StringBuilder();
  563. strSql.Append("SELECT * FROM ( ");
  564. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  565. if (!string.IsNullOrEmpty(orderby.Trim()))
  566. {
  567. strSql.Append("order by T." + orderby);
  568. }
  569. else
  570. {
  571. strSql.Append("order by T.F_Id desc");
  572. }
  573. strSql.Append(")AS Row, T.* from T_Sys_TempItems T ");
  574. if (!string.IsNullOrEmpty(strWhere.Trim()))
  575. {
  576. strSql.Append(" WHERE " + strWhere);
  577. }
  578. strSql.Append(" ) TT");
  579. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  580. return DbHelperSQL.Query(strSql.ToString());
  581. }
  582. /*
  583. /// <summary>
  584. /// 分页获取数据列表
  585. /// </summary>
  586. public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  587. {
  588. SqlParameter[] parameters = {
  589. new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  590. new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  591. new SqlParameter("@PageSize", SqlDbType.Int),
  592. new SqlParameter("@PageIndex", SqlDbType.Int),
  593. new SqlParameter("@IsReCount", SqlDbType.Bit),
  594. new SqlParameter("@OrderType", SqlDbType.Bit),
  595. new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  596. };
  597. parameters[0].Value = "T_Sys_TempItems";
  598. parameters[1].Value = "F_Id";
  599. parameters[2].Value = PageSize;
  600. parameters[3].Value = PageIndex;
  601. parameters[4].Value = 0;
  602. parameters[5].Value = 0;
  603. parameters[6].Value = strWhere;
  604. return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  605. }*/
  606. #endregion Method
  607. }
  608. }