Nessuna descrizione

T_Call_TaskTelNum.cs 47KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  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(" 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 int DeletePhoneByTaskId(long id)
  531. {
  532. StringBuilder strSql = new StringBuilder();
  533. strSql.Append("delete from T_Call_TaskTelNum ");
  534. strSql.Append(" where F_TaskId=@F_TaskId");
  535. SqlParameter[] parameters = {
  536. new SqlParameter("@F_TaskId", SqlDbType.Int,4)
  537. };
  538. parameters[0].Value = id;
  539. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  540. return rows;
  541. }
  542. /// <summary>
  543. /// 得到一个对象实体
  544. /// </summary>
  545. public CallCenterApi.Model.T_Call_TaskTelNum GetModel(int F_Id)
  546. {
  547. StringBuilder strSql = new StringBuilder();
  548. strSql.Append("select top 1 * from T_Call_TaskTelNum ");
  549. strSql.Append(" where F_Id=@F_Id");
  550. SqlParameter[] parameters = {
  551. new SqlParameter("@F_Id", SqlDbType.Int,4)
  552. };
  553. parameters[0].Value = F_Id;
  554. CallCenterApi.Model.T_Call_TaskTelNum model = new CallCenterApi.Model.T_Call_TaskTelNum();
  555. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  556. if (ds.Tables[0].Rows.Count > 0)
  557. {
  558. if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "")
  559. {
  560. model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString());
  561. }
  562. if (ds.Tables[0].Rows[0]["F_TaskId"] != null && ds.Tables[0].Rows[0]["F_TaskId"].ToString() != "")
  563. {
  564. model.F_TaskId = int.Parse(ds.Tables[0].Rows[0]["F_TaskId"].ToString());
  565. }
  566. if (ds.Tables[0].Rows[0]["F_Phone"] != null && ds.Tables[0].Rows[0]["F_Phone"].ToString() != "")
  567. {
  568. model.F_Phone = ds.Tables[0].Rows[0]["F_Phone"].ToString();
  569. }
  570. if (ds.Tables[0].Rows[0]["F_Customer"] != null && ds.Tables[0].Rows[0]["F_Customer"].ToString() != "")
  571. {
  572. model.F_Customer = ds.Tables[0].Rows[0]["F_Customer"].ToString();
  573. }
  574. if (ds.Tables[0].Rows[0]["F_PhoneBy"] != null && ds.Tables[0].Rows[0]["F_PhoneBy"].ToString() != "")
  575. {
  576. model.F_PhoneBy = ds.Tables[0].Rows[0]["F_PhoneBy"].ToString();
  577. }
  578. if (ds.Tables[0].Rows[0]["F_Sex"] != null && ds.Tables[0].Rows[0]["F_Sex"].ToString() != "")
  579. {
  580. model.F_Sex = ds.Tables[0].Rows[0]["F_Sex"].ToString();
  581. }
  582. if (ds.Tables[0].Rows[0]["F_FPState"] != null && ds.Tables[0].Rows[0]["F_FPState"].ToString() != "")
  583. {
  584. model.F_FPState = int.Parse(ds.Tables[0].Rows[0]["F_FPState"].ToString());
  585. }
  586. if (ds.Tables[0].Rows[0]["F_YJState"] != null && ds.Tables[0].Rows[0]["F_YJState"].ToString() != "")
  587. {
  588. model.F_YJState = int.Parse(ds.Tables[0].Rows[0]["F_YJState"].ToString());
  589. }
  590. if (ds.Tables[0].Rows[0]["F_HCState"] != null && ds.Tables[0].Rows[0]["F_HCState"].ToString() != "")
  591. {
  592. model.F_HCState = int.Parse(ds.Tables[0].Rows[0]["F_HCState"].ToString());
  593. }
  594. if (ds.Tables[0].Rows[0]["F_UserId"] != null && ds.Tables[0].Rows[0]["F_UserId"].ToString() != "")
  595. {
  596. model.F_UserId = int.Parse(ds.Tables[0].Rows[0]["F_UserId"].ToString());
  597. }
  598. if (ds.Tables[0].Rows[0]["F_UserName"] != null && ds.Tables[0].Rows[0]["F_UserName"].ToString() != "")
  599. {
  600. model.F_UserName = ds.Tables[0].Rows[0]["F_UserName"].ToString();
  601. }
  602. if (ds.Tables[0].Rows[0]["F_CreateTime"] != null && ds.Tables[0].Rows[0]["F_CreateTime"].ToString() != "")
  603. {
  604. model.F_CreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["F_CreateTime"].ToString());
  605. }
  606. if (ds.Tables[0].Rows[0]["ExpandIntField1"] != null && ds.Tables[0].Rows[0]["ExpandIntField1"].ToString() != "")
  607. {
  608. model.ExpandIntField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField1"].ToString());
  609. }
  610. if (ds.Tables[0].Rows[0]["ExpandIntField2"] != null && ds.Tables[0].Rows[0]["ExpandIntField2"].ToString() != "")
  611. {
  612. model.ExpandIntField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField2"].ToString());
  613. }
  614. if (ds.Tables[0].Rows[0]["ExpandIntField3"] != null && ds.Tables[0].Rows[0]["ExpandIntField3"].ToString() != "")
  615. {
  616. model.ExpandIntField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField3"].ToString());
  617. }
  618. if (ds.Tables[0].Rows[0]["ExpandIntField4"] != null && ds.Tables[0].Rows[0]["ExpandIntField4"].ToString() != "")
  619. {
  620. model.ExpandIntField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField4"].ToString());
  621. }
  622. if (ds.Tables[0].Rows[0]["ExpandIntField5"] != null && ds.Tables[0].Rows[0]["ExpandIntField5"].ToString() != "")
  623. {
  624. model.ExpandIntField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField5"].ToString());
  625. }
  626. if (ds.Tables[0].Rows[0]["ExpandIntField6"] != null && ds.Tables[0].Rows[0]["ExpandIntField6"].ToString() != "")
  627. {
  628. model.ExpandIntField6 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField6"].ToString());
  629. }
  630. if (ds.Tables[0].Rows[0]["ExpandDecField1"] != null && ds.Tables[0].Rows[0]["ExpandDecField1"].ToString() != "")
  631. {
  632. model.ExpandDecField1 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField1"].ToString());
  633. }
  634. if (ds.Tables[0].Rows[0]["ExpandDecField2"] != null && ds.Tables[0].Rows[0]["ExpandDecField2"].ToString() != "")
  635. {
  636. model.ExpandDecField2 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField2"].ToString());
  637. }
  638. if (ds.Tables[0].Rows[0]["ExpandDecField3"] != null && ds.Tables[0].Rows[0]["ExpandDecField3"].ToString() != "")
  639. {
  640. model.ExpandDecField3 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField3"].ToString());
  641. }
  642. if (ds.Tables[0].Rows[0]["ExpandDecField4"] != null && ds.Tables[0].Rows[0]["ExpandDecField4"].ToString() != "")
  643. {
  644. model.ExpandDecField4 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField4"].ToString());
  645. }
  646. if (ds.Tables[0].Rows[0]["ExpandDecField5"] != null && ds.Tables[0].Rows[0]["ExpandDecField5"].ToString() != "")
  647. {
  648. model.ExpandDecField5 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField5"].ToString());
  649. }
  650. if (ds.Tables[0].Rows[0]["ExpandDecField6"] != null && ds.Tables[0].Rows[0]["ExpandDecField6"].ToString() != "")
  651. {
  652. model.ExpandDecField6 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField6"].ToString());
  653. }
  654. if (ds.Tables[0].Rows[0]["ExpandDatField1"] != null && ds.Tables[0].Rows[0]["ExpandDatField1"].ToString() != "")
  655. {
  656. model.ExpandDatField1 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField1"].ToString());
  657. }
  658. if (ds.Tables[0].Rows[0]["ExpandDatField2"] != null && ds.Tables[0].Rows[0]["ExpandDatField2"].ToString() != "")
  659. {
  660. model.ExpandDatField2 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField2"].ToString());
  661. }
  662. if (ds.Tables[0].Rows[0]["ExpandDatField3"] != null && ds.Tables[0].Rows[0]["ExpandDatField3"].ToString() != "")
  663. {
  664. model.ExpandDatField3 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField3"].ToString());
  665. }
  666. if (ds.Tables[0].Rows[0]["ExpandDatField4"] != null && ds.Tables[0].Rows[0]["ExpandDatField4"].ToString() != "")
  667. {
  668. model.ExpandDatField4 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField4"].ToString());
  669. }
  670. if (ds.Tables[0].Rows[0]["ExpandDatField5"] != null && ds.Tables[0].Rows[0]["ExpandDatField5"].ToString() != "")
  671. {
  672. model.ExpandDatField5 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField5"].ToString());
  673. }
  674. if (ds.Tables[0].Rows[0]["ExpandDatField6"] != null && ds.Tables[0].Rows[0]["ExpandDatField6"].ToString() != "")
  675. {
  676. model.ExpandDatField6 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField6"].ToString());
  677. }
  678. if (ds.Tables[0].Rows[0]["ExpandVchField1"] != null && ds.Tables[0].Rows[0]["ExpandVchField1"].ToString() != "")
  679. {
  680. model.ExpandVchField1 = ds.Tables[0].Rows[0]["ExpandVchField1"].ToString();
  681. }
  682. if (ds.Tables[0].Rows[0]["ExpandVchField2"] != null && ds.Tables[0].Rows[0]["ExpandVchField2"].ToString() != "")
  683. {
  684. model.ExpandVchField2 = ds.Tables[0].Rows[0]["ExpandVchField2"].ToString();
  685. }
  686. if (ds.Tables[0].Rows[0]["ExpandVchField3"] != null && ds.Tables[0].Rows[0]["ExpandVchField3"].ToString() != "")
  687. {
  688. model.ExpandVchField3 = ds.Tables[0].Rows[0]["ExpandVchField3"].ToString();
  689. }
  690. if (ds.Tables[0].Rows[0]["ExpandVchField4"] != null && ds.Tables[0].Rows[0]["ExpandVchField4"].ToString() != "")
  691. {
  692. model.ExpandVchField4 = ds.Tables[0].Rows[0]["ExpandVchField4"].ToString();
  693. }
  694. if (ds.Tables[0].Rows[0]["ExpandVchField5"] != null && ds.Tables[0].Rows[0]["ExpandVchField5"].ToString() != "")
  695. {
  696. model.ExpandVchField5 = ds.Tables[0].Rows[0]["ExpandVchField5"].ToString();
  697. }
  698. if (ds.Tables[0].Rows[0]["ExpandVchField6"] != null && ds.Tables[0].Rows[0]["ExpandVchField6"].ToString() != "")
  699. {
  700. model.ExpandVchField6 = ds.Tables[0].Rows[0]["ExpandVchField6"].ToString();
  701. }
  702. if (ds.Tables[0].Rows[0]["ExpandVchField7"] != null && ds.Tables[0].Rows[0]["ExpandVchField7"].ToString() != "")
  703. {
  704. model.ExpandVchField7 = ds.Tables[0].Rows[0]["ExpandVchField7"].ToString();
  705. }
  706. if (ds.Tables[0].Rows[0]["ExpandVchField8"] != null && ds.Tables[0].Rows[0]["ExpandVchField8"].ToString() != "")
  707. {
  708. model.ExpandVchField8 = ds.Tables[0].Rows[0]["ExpandVchField8"].ToString();
  709. }
  710. if (ds.Tables[0].Rows[0]["ExpandVchField9"] != null && ds.Tables[0].Rows[0]["ExpandVchField9"].ToString() != "")
  711. {
  712. model.ExpandVchField9 = ds.Tables[0].Rows[0]["ExpandVchField9"].ToString();
  713. }
  714. if (ds.Tables[0].Rows[0]["ExpandVchField10"] != null && ds.Tables[0].Rows[0]["ExpandVchField10"].ToString() != "")
  715. {
  716. model.ExpandVchField10 = ds.Tables[0].Rows[0]["ExpandVchField10"].ToString();
  717. }
  718. if (ds.Tables[0].Rows[0]["ExpandVchField11"] != null && ds.Tables[0].Rows[0]["ExpandVchField11"].ToString() != "")
  719. {
  720. model.ExpandVchField11 = ds.Tables[0].Rows[0]["ExpandVchField11"].ToString();
  721. }
  722. if (ds.Tables[0].Rows[0]["ExpandVchField12"] != null && ds.Tables[0].Rows[0]["ExpandVchField12"].ToString() != "")
  723. {
  724. model.ExpandVchField12 = ds.Tables[0].Rows[0]["ExpandVchField12"].ToString();
  725. }
  726. if (ds.Tables[0].Rows[0]["ExpandVchField13"] != null && ds.Tables[0].Rows[0]["ExpandVchField13"].ToString() != "")
  727. {
  728. model.ExpandVchField13 = ds.Tables[0].Rows[0]["ExpandVchField13"].ToString();
  729. }
  730. if (ds.Tables[0].Rows[0]["ExpandVchField14"] != null && ds.Tables[0].Rows[0]["ExpandVchField14"].ToString() != "")
  731. {
  732. model.ExpandVchField14 = ds.Tables[0].Rows[0]["ExpandVchField14"].ToString();
  733. }
  734. if (ds.Tables[0].Rows[0]["ExpandVchField15"] != null && ds.Tables[0].Rows[0]["ExpandVchField15"].ToString() != "")
  735. {
  736. model.ExpandVchField15 = ds.Tables[0].Rows[0]["ExpandVchField15"].ToString();
  737. }
  738. if (ds.Tables[0].Rows[0]["ExpandSintField1"] != null && ds.Tables[0].Rows[0]["ExpandSintField1"].ToString() != "")
  739. {
  740. model.ExpandSintField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField1"].ToString());
  741. }
  742. if (ds.Tables[0].Rows[0]["ExpandSintField2"] != null && ds.Tables[0].Rows[0]["ExpandSintField2"].ToString() != "")
  743. {
  744. model.ExpandSintField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField2"].ToString());
  745. }
  746. if (ds.Tables[0].Rows[0]["ExpandSintField3"] != null && ds.Tables[0].Rows[0]["ExpandSintField3"].ToString() != "")
  747. {
  748. model.ExpandSintField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField3"].ToString());
  749. }
  750. if (ds.Tables[0].Rows[0]["ExpandSintField4"] != null && ds.Tables[0].Rows[0]["ExpandSintField4"].ToString() != "")
  751. {
  752. model.ExpandSintField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField4"].ToString());
  753. }
  754. if (ds.Tables[0].Rows[0]["ExpandSintField5"] != null && ds.Tables[0].Rows[0]["ExpandSintField5"].ToString() != "")
  755. {
  756. model.ExpandSintField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField5"].ToString());
  757. }
  758. if (ds.Tables[0].Rows[0]["F_AskInfo"] != null && ds.Tables[0].Rows[0]["F_AskInfo"].ToString() != "")
  759. {
  760. model.F_AskInfo = ds.Tables[0].Rows[0]["F_AskInfo"].ToString();
  761. }
  762. if (ds.Tables[0].Rows[0]["F_AskRes"] != null && ds.Tables[0].Rows[0]["F_AskRes"].ToString() != "")
  763. {
  764. model.F_AskRes = ds.Tables[0].Rows[0]["F_AskRes"].ToString();
  765. }
  766. return model;
  767. }
  768. else
  769. {
  770. return null;
  771. }
  772. }
  773. /// <summary>
  774. /// 获得数据列表
  775. /// </summary>
  776. public DataSet GetList(string strWhere)
  777. {
  778. StringBuilder strSql = new StringBuilder();
  779. strSql.Append("select * ");
  780. strSql.Append(" FROM T_Call_TaskTelNum ");
  781. if (strWhere.Trim() != "")
  782. {
  783. strSql.Append(" where " + strWhere);
  784. }
  785. return DbHelperSQL.Query(strSql.ToString());
  786. }
  787. /// <summary>
  788. /// 获得前几行数据
  789. /// </summary>
  790. public DataSet GetList(int Top, string strWhere, string filedOrder)
  791. {
  792. StringBuilder strSql = new StringBuilder();
  793. strSql.Append("select ");
  794. if (Top > 0)
  795. {
  796. strSql.Append(" top " + Top.ToString());
  797. }
  798. 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 ");
  799. strSql.Append(" FROM T_Call_TaskTelNum ");
  800. if (strWhere.Trim() != "")
  801. {
  802. strSql.Append(" where " + strWhere);
  803. }
  804. strSql.Append(" order by " + filedOrder);
  805. return DbHelperSQL.Query(strSql.ToString());
  806. }
  807. /// <summary>
  808. /// 获取记录总数
  809. /// </summary>
  810. public int GetRecordCount(string strWhere)
  811. {
  812. StringBuilder strSql = new StringBuilder();
  813. strSql.Append("select count(1) FROM T_Call_TaskTelNum ");
  814. if (strWhere.Trim() != "")
  815. {
  816. strSql.Append(" where " + strWhere);
  817. }
  818. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  819. if (obj == null)
  820. {
  821. return 0;
  822. }
  823. else
  824. {
  825. return Convert.ToInt32(obj);
  826. }
  827. }
  828. /// <summary>
  829. /// 分页获取数据列表
  830. /// </summary>
  831. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  832. {
  833. StringBuilder strSql = new StringBuilder();
  834. strSql.Append("SELECT * FROM ( ");
  835. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  836. if (!string.IsNullOrEmpty(orderby.Trim()))
  837. {
  838. strSql.Append("order by T." + orderby);
  839. }
  840. else
  841. {
  842. strSql.Append("order by T.F_Id desc");
  843. }
  844. strSql.Append(")AS Row, T.* from T_Call_TaskTelNum T ");
  845. if (!string.IsNullOrEmpty(strWhere.Trim()))
  846. {
  847. strSql.Append(" WHERE " + strWhere);
  848. }
  849. strSql.Append(" ) TT");
  850. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  851. return DbHelperSQL.Query(strSql.ToString());
  852. }
  853. /// <summary>
  854. /// 获取表结构
  855. /// </summary>
  856. /// <returns></returns>
  857. public DataTable GetTableDesign()
  858. {
  859. return DbHelperSQL.Query("SET FMTONLY ON;SELECT * FROM T_Call_TaskTelNum ;SET FMTONLY OFF; ").Tables[0];
  860. }
  861. /// <summary>
  862. /// 大量数据导入SqlBulkCopy
  863. /// </summary>
  864. /// <returns></returns>
  865. public void SqlBulkCopy(DataTable dt)
  866. {
  867. DbHelperSQL.SqlBulkCopyByDatatable("T_Call_TaskTelNum", dt);
  868. }
  869. /*
  870. /// <summary>
  871. /// 分页获取数据列表
  872. /// </summary>
  873. public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  874. {
  875. SqlParameter[] parameters = {
  876. new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  877. new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  878. new SqlParameter("@PageSize", SqlDbType.Int),
  879. new SqlParameter("@PageIndex", SqlDbType.Int),
  880. new SqlParameter("@IsReCount", SqlDbType.Bit),
  881. new SqlParameter("@OrderType", SqlDbType.Bit),
  882. new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  883. };
  884. parameters[0].Value = "T_Call_TaskTelNum";
  885. parameters[1].Value = "F_Id";
  886. parameters[2].Value = PageSize;
  887. parameters[3].Value = PageIndex;
  888. parameters[4].Value = 0;
  889. parameters[5].Value = 0;
  890. parameters[6].Value = strWhere;
  891. return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  892. }*/
  893. #endregion Method
  894. }
  895. }