Brak opisu

T_Call_TaskTelNum.cs 46KB

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