ZZDianXin_API - 郑州电信演示

T_Call_OutTaskRecords.cs 41KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. using CallCenterApi.DB;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Data.SqlClient;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace CallCenterApi.DAL
  10. {
  11. public partial class T_Call_OutTaskRecords
  12. {
  13. public T_Call_OutTaskRecords()
  14. { }
  15. #region BasicMethod
  16. /// <summary>
  17. /// 是否存在该记录
  18. /// </summary>
  19. public bool Exists(int F_Id)
  20. {
  21. StringBuilder strSql = new StringBuilder();
  22. strSql.Append("select count(1) from T_Call_OutTaskRecords");
  23. strSql.Append(" where F_Id=@F_Id");
  24. SqlParameter[] parameters = {
  25. new SqlParameter("@F_Id", SqlDbType.Int,4)
  26. };
  27. parameters[0].Value = F_Id;
  28. return DbHelperSQL.Exists(strSql.ToString(), parameters);
  29. }
  30. /// <summary>
  31. /// 增加一条数据
  32. /// </summary>
  33. public int Add(CallCenterApi.Model.T_Call_OutTaskRecords model)
  34. {
  35. StringBuilder strSql = new StringBuilder();
  36. strSql.Append("insert into T_Call_OutTaskRecords(");
  37. strSql.Append("F_TelID,F_TaskId,F_CusID,F_CusName,F_Phone,F_PhoneBy,F_FPState,F_YJState,F_HCState,F_UserId,F_UserName,F_CreateTime,F_AskInfo,F_AskRes,F_HJJGId,F_HJJGName,F_YHFKId,F_YHFKName,F_OptTime,F_OptUserCode,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)");
  38. strSql.Append(" values (");
  39. strSql.Append("@F_TelID,@F_TaskId,@F_CusID,@F_CusName,@F_Phone,@F_PhoneBy,@F_FPState,@F_YJState,@F_HCState,@F_UserId,@F_UserName,@F_CreateTime,@F_AskInfo,@F_AskRes,@F_HJJGId,@F_HJJGName,@F_YHFKId,@F_YHFKName,@F_OptTime,@F_OptUserCode,@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(";select @@IDENTITY");
  41. SqlParameter[] parameters = {
  42. new SqlParameter("@F_TelID", SqlDbType.Int,4),
  43. new SqlParameter("@F_TaskId", SqlDbType.Int,4),
  44. new SqlParameter("@F_CusID", SqlDbType.Int,4),
  45. new SqlParameter("@F_CusName", SqlDbType.VarChar,200),
  46. new SqlParameter("@F_Phone", SqlDbType.VarChar,200),
  47. new SqlParameter("@F_PhoneBy", SqlDbType.VarChar,200),
  48. new SqlParameter("@F_FPState", SqlDbType.Int,4),
  49. new SqlParameter("@F_YJState", SqlDbType.Int,4),
  50. new SqlParameter("@F_HCState", SqlDbType.Int,4),
  51. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  52. new SqlParameter("@F_UserName", SqlDbType.VarChar,50),
  53. new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
  54. new SqlParameter("@F_AskInfo", SqlDbType.Text),
  55. new SqlParameter("@F_AskRes", SqlDbType.Text),
  56. new SqlParameter("@F_HJJGId", SqlDbType.Int,4),
  57. new SqlParameter("@F_HJJGName", SqlDbType.NVarChar,500),
  58. new SqlParameter("@F_YHFKId", SqlDbType.Int,4),
  59. new SqlParameter("@F_YHFKName", SqlDbType.NVarChar,500),
  60. new SqlParameter("@F_OptTime", SqlDbType.DateTime),
  61. new SqlParameter("@F_OptUserCode", SqlDbType.VarChar,50),
  62. new SqlParameter("@ExpandIntField1", SqlDbType.Int,4),
  63. new SqlParameter("@ExpandIntField2", SqlDbType.Int,4),
  64. new SqlParameter("@ExpandIntField3", SqlDbType.Int,4),
  65. new SqlParameter("@ExpandIntField4", SqlDbType.Int,4),
  66. new SqlParameter("@ExpandIntField5", SqlDbType.Int,4),
  67. new SqlParameter("@ExpandIntField6", SqlDbType.Int,4),
  68. new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9),
  69. new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9),
  70. new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9),
  71. new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9),
  72. new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9),
  73. new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9),
  74. new SqlParameter("@ExpandDatField1", SqlDbType.DateTime),
  75. new SqlParameter("@ExpandDatField2", SqlDbType.DateTime),
  76. new SqlParameter("@ExpandDatField3", SqlDbType.DateTime),
  77. new SqlParameter("@ExpandDatField4", SqlDbType.DateTime),
  78. new SqlParameter("@ExpandDatField5", SqlDbType.DateTime),
  79. new SqlParameter("@ExpandDatField6", SqlDbType.DateTime),
  80. new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200),
  81. new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200),
  82. new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200),
  83. new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200),
  84. new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200),
  85. new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200),
  86. new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200),
  87. new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200),
  88. new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200),
  89. new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500),
  90. new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500),
  91. new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000),
  92. new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000),
  93. new SqlParameter("@ExpandVchField14", SqlDbType.Text),
  94. new SqlParameter("@ExpandVchField15", SqlDbType.Text),
  95. new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2),
  96. new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2),
  97. new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2),
  98. new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2),
  99. new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2)};
  100. parameters[0].Value = model.F_TelID;
  101. parameters[1].Value = model.F_TaskId;
  102. parameters[2].Value = model.F_CusID;
  103. parameters[3].Value = model.F_CusName;
  104. parameters[4].Value = model.F_Phone;
  105. parameters[5].Value = model.F_PhoneBy;
  106. parameters[6].Value = model.F_FPState;
  107. parameters[7].Value = model.F_YJState;
  108. parameters[8].Value = model.F_HCState;
  109. parameters[9].Value = model.F_UserId;
  110. parameters[10].Value = model.F_UserName;
  111. parameters[11].Value = model.F_CreateTime;
  112. parameters[12].Value = model.F_AskInfo;
  113. parameters[13].Value = model.F_AskRes;
  114. parameters[14].Value = model.F_HJJGId;
  115. parameters[15].Value = model.F_HJJGName;
  116. parameters[16].Value = model.F_YHFKId;
  117. parameters[17].Value = model.F_YHFKName;
  118. parameters[18].Value = model.F_OptTime;
  119. parameters[19].Value = model.F_OptUserCode;
  120. parameters[20].Value = model.ExpandIntField1;
  121. parameters[21].Value = model.ExpandIntField2;
  122. parameters[22].Value = model.ExpandIntField3;
  123. parameters[23].Value = model.ExpandIntField4;
  124. parameters[24].Value = model.ExpandIntField5;
  125. parameters[25].Value = model.ExpandIntField6;
  126. parameters[26].Value = model.ExpandDecField1;
  127. parameters[27].Value = model.ExpandDecField2;
  128. parameters[28].Value = model.ExpandDecField3;
  129. parameters[29].Value = model.ExpandDecField4;
  130. parameters[30].Value = model.ExpandDecField5;
  131. parameters[31].Value = model.ExpandDecField6;
  132. parameters[32].Value = model.ExpandDatField1;
  133. parameters[33].Value = model.ExpandDatField2;
  134. parameters[34].Value = model.ExpandDatField3;
  135. parameters[35].Value = model.ExpandDatField4;
  136. parameters[36].Value = model.ExpandDatField5;
  137. parameters[37].Value = model.ExpandDatField6;
  138. parameters[38].Value = model.ExpandVchField1;
  139. parameters[39].Value = model.ExpandVchField2;
  140. parameters[40].Value = model.ExpandVchField3;
  141. parameters[41].Value = model.ExpandVchField4;
  142. parameters[42].Value = model.ExpandVchField5;
  143. parameters[43].Value = model.ExpandVchField6;
  144. parameters[44].Value = model.ExpandVchField7;
  145. parameters[45].Value = model.ExpandVchField8;
  146. parameters[46].Value = model.ExpandVchField9;
  147. parameters[47].Value = model.ExpandVchField10;
  148. parameters[48].Value = model.ExpandVchField11;
  149. parameters[49].Value = model.ExpandVchField12;
  150. parameters[50].Value = model.ExpandVchField13;
  151. parameters[51].Value = model.ExpandVchField14;
  152. parameters[52].Value = model.ExpandVchField15;
  153. parameters[53].Value = model.ExpandSintField1;
  154. parameters[54].Value = model.ExpandSintField2;
  155. parameters[55].Value = model.ExpandSintField3;
  156. parameters[56].Value = model.ExpandSintField4;
  157. parameters[57].Value = model.ExpandSintField5;
  158. object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
  159. if (obj == null)
  160. {
  161. return 0;
  162. }
  163. else
  164. {
  165. return Convert.ToInt32(obj);
  166. }
  167. }
  168. /// <summary>
  169. /// 更新一条数据
  170. /// </summary>
  171. public bool Update(CallCenterApi.Model.T_Call_OutTaskRecords model)
  172. {
  173. StringBuilder strSql = new StringBuilder();
  174. strSql.Append("update T_Call_OutTaskRecords set ");
  175. strSql.Append("F_TelID=@F_TelID,");
  176. strSql.Append("F_TaskId=@F_TaskId,");
  177. strSql.Append("F_CusID=@F_CusID,");
  178. strSql.Append("F_CusName=@F_CusName,");
  179. strSql.Append("F_Phone=@F_Phone,");
  180. strSql.Append("F_PhoneBy=@F_PhoneBy,");
  181. strSql.Append("F_FPState=@F_FPState,");
  182. strSql.Append("F_YJState=@F_YJState,");
  183. strSql.Append("F_HCState=@F_HCState,");
  184. strSql.Append("F_UserId=@F_UserId,");
  185. strSql.Append("F_UserName=@F_UserName,");
  186. strSql.Append("F_CreateTime=@F_CreateTime,");
  187. strSql.Append("F_AskInfo=@F_AskInfo,");
  188. strSql.Append("F_AskRes=@F_AskRes,");
  189. strSql.Append("F_HJJGId=@F_HJJGId,");
  190. strSql.Append("F_HJJGName=@F_HJJGName,");
  191. strSql.Append("F_YHFKId=@F_YHFKId,");
  192. strSql.Append("F_YHFKName=@F_YHFKName,");
  193. strSql.Append("F_OptTime=@F_OptTime,");
  194. strSql.Append("F_OptUserCode=@F_OptUserCode,");
  195. strSql.Append("ExpandIntField1=@ExpandIntField1,");
  196. strSql.Append("ExpandIntField2=@ExpandIntField2,");
  197. strSql.Append("ExpandIntField3=@ExpandIntField3,");
  198. strSql.Append("ExpandIntField4=@ExpandIntField4,");
  199. strSql.Append("ExpandIntField5=@ExpandIntField5,");
  200. strSql.Append("ExpandIntField6=@ExpandIntField6,");
  201. strSql.Append("ExpandDecField1=@ExpandDecField1,");
  202. strSql.Append("ExpandDecField2=@ExpandDecField2,");
  203. strSql.Append("ExpandDecField3=@ExpandDecField3,");
  204. strSql.Append("ExpandDecField4=@ExpandDecField4,");
  205. strSql.Append("ExpandDecField5=@ExpandDecField5,");
  206. strSql.Append("ExpandDecField6=@ExpandDecField6,");
  207. strSql.Append("ExpandDatField1=@ExpandDatField1,");
  208. strSql.Append("ExpandDatField2=@ExpandDatField2,");
  209. strSql.Append("ExpandDatField3=@ExpandDatField3,");
  210. strSql.Append("ExpandDatField4=@ExpandDatField4,");
  211. strSql.Append("ExpandDatField5=@ExpandDatField5,");
  212. strSql.Append("ExpandDatField6=@ExpandDatField6,");
  213. strSql.Append("ExpandVchField1=@ExpandVchField1,");
  214. strSql.Append("ExpandVchField2=@ExpandVchField2,");
  215. strSql.Append("ExpandVchField3=@ExpandVchField3,");
  216. strSql.Append("ExpandVchField4=@ExpandVchField4,");
  217. strSql.Append("ExpandVchField5=@ExpandVchField5,");
  218. strSql.Append("ExpandVchField6=@ExpandVchField6,");
  219. strSql.Append("ExpandVchField7=@ExpandVchField7,");
  220. strSql.Append("ExpandVchField8=@ExpandVchField8,");
  221. strSql.Append("ExpandVchField9=@ExpandVchField9,");
  222. strSql.Append("ExpandVchField10=@ExpandVchField10,");
  223. strSql.Append("ExpandVchField11=@ExpandVchField11,");
  224. strSql.Append("ExpandVchField12=@ExpandVchField12,");
  225. strSql.Append("ExpandVchField13=@ExpandVchField13,");
  226. strSql.Append("ExpandVchField14=@ExpandVchField14,");
  227. strSql.Append("ExpandVchField15=@ExpandVchField15,");
  228. strSql.Append("ExpandSintField1=@ExpandSintField1,");
  229. strSql.Append("ExpandSintField2=@ExpandSintField2,");
  230. strSql.Append("ExpandSintField3=@ExpandSintField3,");
  231. strSql.Append("ExpandSintField4=@ExpandSintField4,");
  232. strSql.Append("ExpandSintField5=@ExpandSintField5");
  233. strSql.Append(" where F_Id=@F_Id");
  234. SqlParameter[] parameters = {
  235. new SqlParameter("@F_TelID", SqlDbType.Int,4),
  236. new SqlParameter("@F_TaskId", SqlDbType.Int,4),
  237. new SqlParameter("@F_CusID", SqlDbType.Int,4),
  238. new SqlParameter("@F_CusName", SqlDbType.VarChar,200),
  239. new SqlParameter("@F_Phone", SqlDbType.VarChar,200),
  240. new SqlParameter("@F_PhoneBy", SqlDbType.VarChar,200),
  241. new SqlParameter("@F_FPState", SqlDbType.Int,4),
  242. new SqlParameter("@F_YJState", SqlDbType.Int,4),
  243. new SqlParameter("@F_HCState", SqlDbType.Int,4),
  244. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  245. new SqlParameter("@F_UserName", SqlDbType.VarChar,50),
  246. new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
  247. new SqlParameter("@F_AskInfo", SqlDbType.Text),
  248. new SqlParameter("@F_AskRes", SqlDbType.Text),
  249. new SqlParameter("@F_HJJGId", SqlDbType.Int,4),
  250. new SqlParameter("@F_HJJGName", SqlDbType.NVarChar,500),
  251. new SqlParameter("@F_YHFKId", SqlDbType.Int,4),
  252. new SqlParameter("@F_YHFKName", SqlDbType.NVarChar,500),
  253. new SqlParameter("@F_OptTime", SqlDbType.DateTime),
  254. new SqlParameter("@F_OptUserCode", SqlDbType.VarChar,50),
  255. new SqlParameter("@ExpandIntField1", SqlDbType.Int,4),
  256. new SqlParameter("@ExpandIntField2", SqlDbType.Int,4),
  257. new SqlParameter("@ExpandIntField3", SqlDbType.Int,4),
  258. new SqlParameter("@ExpandIntField4", SqlDbType.Int,4),
  259. new SqlParameter("@ExpandIntField5", SqlDbType.Int,4),
  260. new SqlParameter("@ExpandIntField6", SqlDbType.Int,4),
  261. new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9),
  262. new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9),
  263. new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9),
  264. new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9),
  265. new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9),
  266. new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9),
  267. new SqlParameter("@ExpandDatField1", SqlDbType.DateTime),
  268. new SqlParameter("@ExpandDatField2", SqlDbType.DateTime),
  269. new SqlParameter("@ExpandDatField3", SqlDbType.DateTime),
  270. new SqlParameter("@ExpandDatField4", SqlDbType.DateTime),
  271. new SqlParameter("@ExpandDatField5", SqlDbType.DateTime),
  272. new SqlParameter("@ExpandDatField6", SqlDbType.DateTime),
  273. new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200),
  274. new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200),
  275. new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200),
  276. new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200),
  277. new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200),
  278. new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200),
  279. new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200),
  280. new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200),
  281. new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200),
  282. new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500),
  283. new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500),
  284. new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000),
  285. new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000),
  286. new SqlParameter("@ExpandVchField14", SqlDbType.Text),
  287. new SqlParameter("@ExpandVchField15", SqlDbType.Text),
  288. new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2),
  289. new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2),
  290. new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2),
  291. new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2),
  292. new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2),
  293. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  294. parameters[0].Value = model.F_TelID;
  295. parameters[1].Value = model.F_TaskId;
  296. parameters[2].Value = model.F_CusID;
  297. parameters[3].Value = model.F_CusName;
  298. parameters[4].Value = model.F_Phone;
  299. parameters[5].Value = model.F_PhoneBy;
  300. parameters[6].Value = model.F_FPState;
  301. parameters[7].Value = model.F_YJState;
  302. parameters[8].Value = model.F_HCState;
  303. parameters[9].Value = model.F_UserId;
  304. parameters[10].Value = model.F_UserName;
  305. parameters[11].Value = model.F_CreateTime;
  306. parameters[12].Value = model.F_AskInfo;
  307. parameters[13].Value = model.F_AskRes;
  308. parameters[14].Value = model.F_HJJGId;
  309. parameters[15].Value = model.F_HJJGName;
  310. parameters[16].Value = model.F_YHFKId;
  311. parameters[17].Value = model.F_YHFKName;
  312. parameters[18].Value = model.F_OptTime;
  313. parameters[19].Value = model.F_OptUserCode;
  314. parameters[20].Value = model.ExpandIntField1;
  315. parameters[21].Value = model.ExpandIntField2;
  316. parameters[22].Value = model.ExpandIntField3;
  317. parameters[23].Value = model.ExpandIntField4;
  318. parameters[24].Value = model.ExpandIntField5;
  319. parameters[25].Value = model.ExpandIntField6;
  320. parameters[26].Value = model.ExpandDecField1;
  321. parameters[27].Value = model.ExpandDecField2;
  322. parameters[28].Value = model.ExpandDecField3;
  323. parameters[29].Value = model.ExpandDecField4;
  324. parameters[30].Value = model.ExpandDecField5;
  325. parameters[31].Value = model.ExpandDecField6;
  326. parameters[32].Value = model.ExpandDatField1;
  327. parameters[33].Value = model.ExpandDatField2;
  328. parameters[34].Value = model.ExpandDatField3;
  329. parameters[35].Value = model.ExpandDatField4;
  330. parameters[36].Value = model.ExpandDatField5;
  331. parameters[37].Value = model.ExpandDatField6;
  332. parameters[38].Value = model.ExpandVchField1;
  333. parameters[39].Value = model.ExpandVchField2;
  334. parameters[40].Value = model.ExpandVchField3;
  335. parameters[41].Value = model.ExpandVchField4;
  336. parameters[42].Value = model.ExpandVchField5;
  337. parameters[43].Value = model.ExpandVchField6;
  338. parameters[44].Value = model.ExpandVchField7;
  339. parameters[45].Value = model.ExpandVchField8;
  340. parameters[46].Value = model.ExpandVchField9;
  341. parameters[47].Value = model.ExpandVchField10;
  342. parameters[48].Value = model.ExpandVchField11;
  343. parameters[49].Value = model.ExpandVchField12;
  344. parameters[50].Value = model.ExpandVchField13;
  345. parameters[51].Value = model.ExpandVchField14;
  346. parameters[52].Value = model.ExpandVchField15;
  347. parameters[53].Value = model.ExpandSintField1;
  348. parameters[54].Value = model.ExpandSintField2;
  349. parameters[55].Value = model.ExpandSintField3;
  350. parameters[56].Value = model.ExpandSintField4;
  351. parameters[57].Value = model.ExpandSintField5;
  352. parameters[58].Value = model.F_Id;
  353. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  354. if (rows > 0)
  355. {
  356. return true;
  357. }
  358. else
  359. {
  360. return false;
  361. }
  362. }
  363. /// <summary>
  364. /// 删除一条数据
  365. /// </summary>
  366. public bool Delete(int F_Id)
  367. {
  368. StringBuilder strSql = new StringBuilder();
  369. strSql.Append("delete from T_Call_OutTaskRecords ");
  370. strSql.Append(" where F_Id=@F_Id");
  371. SqlParameter[] parameters = {
  372. new SqlParameter("@F_Id", SqlDbType.Int,4)
  373. };
  374. parameters[0].Value = F_Id;
  375. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  376. if (rows > 0)
  377. {
  378. return true;
  379. }
  380. else
  381. {
  382. return false;
  383. }
  384. }
  385. /// <summary>
  386. /// 批量删除数据
  387. /// </summary>
  388. public bool DeleteList(string F_Idlist)
  389. {
  390. StringBuilder strSql = new StringBuilder();
  391. strSql.Append("delete from T_Call_OutTaskRecords ");
  392. strSql.Append(" where F_Id in (" + F_Idlist + ") ");
  393. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  394. if (rows > 0)
  395. {
  396. return true;
  397. }
  398. else
  399. {
  400. return false;
  401. }
  402. }
  403. /// <summary>
  404. /// 得到一个对象实体
  405. /// </summary>
  406. public CallCenterApi.Model.T_Call_OutTaskRecords GetModel(int F_Id)
  407. {
  408. StringBuilder strSql = new StringBuilder();
  409. strSql.Append("select top 1 F_Id,F_TelID,F_TaskId,F_CusID,F_CusName,F_Phone,F_PhoneBy,F_FPState,F_YJState,F_HCState,F_UserId,F_UserName,F_CreateTime,F_AskInfo,F_AskRes,F_HJJGId,F_HJJGName,F_YHFKId,F_YHFKName,F_OptTime,F_OptUserCode,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_Call_OutTaskRecords ");
  410. strSql.Append(" where F_Id=@F_Id");
  411. SqlParameter[] parameters = {
  412. new SqlParameter("@F_Id", SqlDbType.Int,4)
  413. };
  414. parameters[0].Value = F_Id;
  415. CallCenterApi.Model.T_Call_OutTaskRecords model = new CallCenterApi.Model.T_Call_OutTaskRecords();
  416. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  417. if (ds.Tables[0].Rows.Count > 0)
  418. {
  419. return DataRowToModel(ds.Tables[0].Rows[0]);
  420. }
  421. else
  422. {
  423. return null;
  424. }
  425. }
  426. /// <summary>
  427. /// 得到一个对象实体
  428. /// </summary>
  429. public CallCenterApi.Model.T_Call_OutTaskRecords DataRowToModel(DataRow row)
  430. {
  431. CallCenterApi.Model.T_Call_OutTaskRecords model = new CallCenterApi.Model.T_Call_OutTaskRecords();
  432. if (row != null)
  433. {
  434. if (row["F_Id"] != null && row["F_Id"].ToString() != "")
  435. {
  436. model.F_Id = int.Parse(row["F_Id"].ToString());
  437. }
  438. if (row["F_TelID"] != null && row["F_TelID"].ToString() != "")
  439. {
  440. model.F_TelID = int.Parse(row["F_TelID"].ToString());
  441. }
  442. if (row["F_TaskId"] != null && row["F_TaskId"].ToString() != "")
  443. {
  444. model.F_TaskId = int.Parse(row["F_TaskId"].ToString());
  445. }
  446. if (row["F_CusID"] != null && row["F_CusID"].ToString() != "")
  447. {
  448. model.F_CusID = int.Parse(row["F_CusID"].ToString());
  449. }
  450. if (row["F_CusName"] != null)
  451. {
  452. model.F_CusName = row["F_CusName"].ToString();
  453. }
  454. if (row["F_Phone"] != null)
  455. {
  456. model.F_Phone = row["F_Phone"].ToString();
  457. }
  458. if (row["F_PhoneBy"] != null)
  459. {
  460. model.F_PhoneBy = row["F_PhoneBy"].ToString();
  461. }
  462. if (row["F_FPState"] != null && row["F_FPState"].ToString() != "")
  463. {
  464. model.F_FPState = int.Parse(row["F_FPState"].ToString());
  465. }
  466. if (row["F_YJState"] != null && row["F_YJState"].ToString() != "")
  467. {
  468. model.F_YJState = int.Parse(row["F_YJState"].ToString());
  469. }
  470. if (row["F_HCState"] != null && row["F_HCState"].ToString() != "")
  471. {
  472. model.F_HCState = int.Parse(row["F_HCState"].ToString());
  473. }
  474. if (row["F_UserId"] != null && row["F_UserId"].ToString() != "")
  475. {
  476. model.F_UserId = int.Parse(row["F_UserId"].ToString());
  477. }
  478. if (row["F_UserName"] != null)
  479. {
  480. model.F_UserName = row["F_UserName"].ToString();
  481. }
  482. if (row["F_CreateTime"] != null && row["F_CreateTime"].ToString() != "")
  483. {
  484. model.F_CreateTime = DateTime.Parse(row["F_CreateTime"].ToString());
  485. }
  486. if (row["F_AskInfo"] != null)
  487. {
  488. model.F_AskInfo = row["F_AskInfo"].ToString();
  489. }
  490. if (row["F_AskRes"] != null)
  491. {
  492. model.F_AskRes = row["F_AskRes"].ToString();
  493. }
  494. if (row["F_HJJGId"] != null && row["F_HJJGId"].ToString() != "")
  495. {
  496. model.F_HJJGId = int.Parse(row["F_HJJGId"].ToString());
  497. }
  498. if (row["F_HJJGName"] != null)
  499. {
  500. model.F_HJJGName = row["F_HJJGName"].ToString();
  501. }
  502. if (row["F_YHFKId"] != null && row["F_YHFKId"].ToString() != "")
  503. {
  504. model.F_YHFKId = int.Parse(row["F_YHFKId"].ToString());
  505. }
  506. if (row["F_YHFKName"] != null)
  507. {
  508. model.F_YHFKName = row["F_YHFKName"].ToString();
  509. }
  510. if (row["F_OptTime"] != null && row["F_OptTime"].ToString() != "")
  511. {
  512. model.F_OptTime = DateTime.Parse(row["F_OptTime"].ToString());
  513. }
  514. if (row["F_OptUserCode"] != null)
  515. {
  516. model.F_OptUserCode = row["F_OptUserCode"].ToString();
  517. }
  518. if (row["ExpandIntField1"] != null && row["ExpandIntField1"].ToString() != "")
  519. {
  520. model.ExpandIntField1 = int.Parse(row["ExpandIntField1"].ToString());
  521. }
  522. if (row["ExpandIntField2"] != null && row["ExpandIntField2"].ToString() != "")
  523. {
  524. model.ExpandIntField2 = int.Parse(row["ExpandIntField2"].ToString());
  525. }
  526. if (row["ExpandIntField3"] != null && row["ExpandIntField3"].ToString() != "")
  527. {
  528. model.ExpandIntField3 = int.Parse(row["ExpandIntField3"].ToString());
  529. }
  530. if (row["ExpandIntField4"] != null && row["ExpandIntField4"].ToString() != "")
  531. {
  532. model.ExpandIntField4 = int.Parse(row["ExpandIntField4"].ToString());
  533. }
  534. if (row["ExpandIntField5"] != null && row["ExpandIntField5"].ToString() != "")
  535. {
  536. model.ExpandIntField5 = int.Parse(row["ExpandIntField5"].ToString());
  537. }
  538. if (row["ExpandIntField6"] != null && row["ExpandIntField6"].ToString() != "")
  539. {
  540. model.ExpandIntField6 = int.Parse(row["ExpandIntField6"].ToString());
  541. }
  542. if (row["ExpandDecField1"] != null && row["ExpandDecField1"].ToString() != "")
  543. {
  544. model.ExpandDecField1 = decimal.Parse(row["ExpandDecField1"].ToString());
  545. }
  546. if (row["ExpandDecField2"] != null && row["ExpandDecField2"].ToString() != "")
  547. {
  548. model.ExpandDecField2 = decimal.Parse(row["ExpandDecField2"].ToString());
  549. }
  550. if (row["ExpandDecField3"] != null && row["ExpandDecField3"].ToString() != "")
  551. {
  552. model.ExpandDecField3 = decimal.Parse(row["ExpandDecField3"].ToString());
  553. }
  554. if (row["ExpandDecField4"] != null && row["ExpandDecField4"].ToString() != "")
  555. {
  556. model.ExpandDecField4 = decimal.Parse(row["ExpandDecField4"].ToString());
  557. }
  558. if (row["ExpandDecField5"] != null && row["ExpandDecField5"].ToString() != "")
  559. {
  560. model.ExpandDecField5 = decimal.Parse(row["ExpandDecField5"].ToString());
  561. }
  562. if (row["ExpandDecField6"] != null && row["ExpandDecField6"].ToString() != "")
  563. {
  564. model.ExpandDecField6 = decimal.Parse(row["ExpandDecField6"].ToString());
  565. }
  566. if (row["ExpandDatField1"] != null && row["ExpandDatField1"].ToString() != "")
  567. {
  568. model.ExpandDatField1 = DateTime.Parse(row["ExpandDatField1"].ToString());
  569. }
  570. if (row["ExpandDatField2"] != null && row["ExpandDatField2"].ToString() != "")
  571. {
  572. model.ExpandDatField2 = DateTime.Parse(row["ExpandDatField2"].ToString());
  573. }
  574. if (row["ExpandDatField3"] != null && row["ExpandDatField3"].ToString() != "")
  575. {
  576. model.ExpandDatField3 = DateTime.Parse(row["ExpandDatField3"].ToString());
  577. }
  578. if (row["ExpandDatField4"] != null && row["ExpandDatField4"].ToString() != "")
  579. {
  580. model.ExpandDatField4 = DateTime.Parse(row["ExpandDatField4"].ToString());
  581. }
  582. if (row["ExpandDatField5"] != null && row["ExpandDatField5"].ToString() != "")
  583. {
  584. model.ExpandDatField5 = DateTime.Parse(row["ExpandDatField5"].ToString());
  585. }
  586. if (row["ExpandDatField6"] != null && row["ExpandDatField6"].ToString() != "")
  587. {
  588. model.ExpandDatField6 = DateTime.Parse(row["ExpandDatField6"].ToString());
  589. }
  590. if (row["ExpandVchField1"] != null)
  591. {
  592. model.ExpandVchField1 = row["ExpandVchField1"].ToString();
  593. }
  594. if (row["ExpandVchField2"] != null)
  595. {
  596. model.ExpandVchField2 = row["ExpandVchField2"].ToString();
  597. }
  598. if (row["ExpandVchField3"] != null)
  599. {
  600. model.ExpandVchField3 = row["ExpandVchField3"].ToString();
  601. }
  602. if (row["ExpandVchField4"] != null)
  603. {
  604. model.ExpandVchField4 = row["ExpandVchField4"].ToString();
  605. }
  606. if (row["ExpandVchField5"] != null)
  607. {
  608. model.ExpandVchField5 = row["ExpandVchField5"].ToString();
  609. }
  610. if (row["ExpandVchField6"] != null)
  611. {
  612. model.ExpandVchField6 = row["ExpandVchField6"].ToString();
  613. }
  614. if (row["ExpandVchField7"] != null)
  615. {
  616. model.ExpandVchField7 = row["ExpandVchField7"].ToString();
  617. }
  618. if (row["ExpandVchField8"] != null)
  619. {
  620. model.ExpandVchField8 = row["ExpandVchField8"].ToString();
  621. }
  622. if (row["ExpandVchField9"] != null)
  623. {
  624. model.ExpandVchField9 = row["ExpandVchField9"].ToString();
  625. }
  626. if (row["ExpandVchField10"] != null)
  627. {
  628. model.ExpandVchField10 = row["ExpandVchField10"].ToString();
  629. }
  630. if (row["ExpandVchField11"] != null)
  631. {
  632. model.ExpandVchField11 = row["ExpandVchField11"].ToString();
  633. }
  634. if (row["ExpandVchField12"] != null)
  635. {
  636. model.ExpandVchField12 = row["ExpandVchField12"].ToString();
  637. }
  638. if (row["ExpandVchField13"] != null)
  639. {
  640. model.ExpandVchField13 = row["ExpandVchField13"].ToString();
  641. }
  642. if (row["ExpandVchField14"] != null)
  643. {
  644. model.ExpandVchField14 = row["ExpandVchField14"].ToString();
  645. }
  646. if (row["ExpandVchField15"] != null)
  647. {
  648. model.ExpandVchField15 = row["ExpandVchField15"].ToString();
  649. }
  650. if (row["ExpandSintField1"] != null && row["ExpandSintField1"].ToString() != "")
  651. {
  652. model.ExpandSintField1 = int.Parse(row["ExpandSintField1"].ToString());
  653. }
  654. if (row["ExpandSintField2"] != null && row["ExpandSintField2"].ToString() != "")
  655. {
  656. model.ExpandSintField2 = int.Parse(row["ExpandSintField2"].ToString());
  657. }
  658. if (row["ExpandSintField3"] != null && row["ExpandSintField3"].ToString() != "")
  659. {
  660. model.ExpandSintField3 = int.Parse(row["ExpandSintField3"].ToString());
  661. }
  662. if (row["ExpandSintField4"] != null && row["ExpandSintField4"].ToString() != "")
  663. {
  664. model.ExpandSintField4 = int.Parse(row["ExpandSintField4"].ToString());
  665. }
  666. if (row["ExpandSintField5"] != null && row["ExpandSintField5"].ToString() != "")
  667. {
  668. model.ExpandSintField5 = int.Parse(row["ExpandSintField5"].ToString());
  669. }
  670. }
  671. return model;
  672. }
  673. /// <summary>
  674. /// 获得数据列表
  675. /// </summary>
  676. public DataSet GetList(string strWhere)
  677. {
  678. StringBuilder strSql = new StringBuilder();
  679. strSql.Append("select F_Id,F_TelID,F_TaskId,F_CusID,F_CusName,F_Phone,F_PhoneBy,F_FPState,F_YJState,F_HCState,F_UserId,F_UserName,F_CreateTime,F_AskInfo,F_AskRes,F_HJJGId,F_HJJGName,F_YHFKId,F_YHFKName,F_OptTime,F_OptUserCode,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 ");
  680. strSql.Append(" FROM T_Call_OutTaskRecords ");
  681. if (strWhere.Trim() != "")
  682. {
  683. strSql.Append(" where " + strWhere);
  684. }
  685. return DbHelperSQL.Query(strSql.ToString());
  686. }
  687. /// <summary>
  688. /// 获得前几行数据
  689. /// </summary>
  690. public DataSet GetList(int Top, string strWhere, string filedOrder)
  691. {
  692. StringBuilder strSql = new StringBuilder();
  693. strSql.Append("select ");
  694. if (Top > 0)
  695. {
  696. strSql.Append(" top " + Top.ToString());
  697. }
  698. strSql.Append(" F_Id,F_TelID,F_TaskId,F_CusID,F_CusName,F_Phone,F_PhoneBy,F_FPState,F_YJState,F_HCState,F_UserId,F_UserName,F_CreateTime,F_AskInfo,F_AskRes,F_HJJGId,F_HJJGName,F_YHFKId,F_YHFKName,F_OptTime,F_OptUserCode,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 ");
  699. strSql.Append(" FROM T_Call_OutTaskRecords ");
  700. if (strWhere.Trim() != "")
  701. {
  702. strSql.Append(" where " + strWhere);
  703. }
  704. strSql.Append(" order by " + filedOrder);
  705. return DbHelperSQL.Query(strSql.ToString());
  706. }
  707. /// <summary>
  708. /// 获取记录总数
  709. /// </summary>
  710. public int GetRecordCount(string strWhere)
  711. {
  712. StringBuilder strSql = new StringBuilder();
  713. strSql.Append("select count(1) FROM T_Call_OutTaskRecords ");
  714. if (strWhere.Trim() != "")
  715. {
  716. strSql.Append(" where " + strWhere);
  717. }
  718. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  719. if (obj == null)
  720. {
  721. return 0;
  722. }
  723. else
  724. {
  725. return Convert.ToInt32(obj);
  726. }
  727. }
  728. /// <summary>
  729. /// 分页获取数据列表
  730. /// </summary>
  731. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  732. {
  733. StringBuilder strSql = new StringBuilder();
  734. strSql.Append("SELECT * FROM ( ");
  735. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  736. if (!string.IsNullOrEmpty(orderby.Trim()))
  737. {
  738. strSql.Append("order by T." + orderby);
  739. }
  740. else
  741. {
  742. strSql.Append("order by T.F_Id desc");
  743. }
  744. strSql.Append(")AS Row, T.* from T_Call_OutTaskRecords T ");
  745. if (!string.IsNullOrEmpty(strWhere.Trim()))
  746. {
  747. strSql.Append(" WHERE " + strWhere);
  748. }
  749. strSql.Append(" ) TT");
  750. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  751. return DbHelperSQL.Query(strSql.ToString());
  752. }
  753. #endregion BasicMethod
  754. #region ExtensionMethod
  755. #endregion ExtensionMethod
  756. }
  757. }