鄂尔多斯-招源科技

T_Call_TaskTelNum.cs 49KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  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("F_HJJGId=@F_HJJGId,");
  210. strSql.Append("F_YHFKID=@F_YHFKID,");
  211. strSql.Append("F_Remark=@F_Remark");
  212. strSql.Append(" where F_Id=@F_Id");
  213. SqlParameter[] parameters = {
  214. new SqlParameter("@F_TaskId", SqlDbType.Int,4),
  215. new SqlParameter("@F_Phone", SqlDbType.VarChar,200),
  216. new SqlParameter("@F_Customer", SqlDbType.VarChar,200),
  217. new SqlParameter("@F_PhoneBy", SqlDbType.VarChar,200),
  218. new SqlParameter("@F_Sex", SqlDbType.VarChar,20),
  219. new SqlParameter("@F_FPState", SqlDbType.Int,4),
  220. new SqlParameter("@F_YJState", SqlDbType.Int,4),
  221. new SqlParameter("@F_HCState", SqlDbType.Int,4),
  222. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  223. new SqlParameter("@F_UserName", SqlDbType.VarChar,50),
  224. new SqlParameter("@F_CreateTime", SqlDbType.DateTime),
  225. new SqlParameter("@ExpandIntField1", SqlDbType.Int,4),
  226. new SqlParameter("@ExpandIntField2", SqlDbType.Int,4),
  227. new SqlParameter("@ExpandIntField3", SqlDbType.Int,4),
  228. new SqlParameter("@ExpandIntField4", SqlDbType.Int,4),
  229. new SqlParameter("@ExpandIntField5", SqlDbType.Int,4),
  230. new SqlParameter("@ExpandIntField6", SqlDbType.Int,4),
  231. new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9),
  232. new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9),
  233. new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9),
  234. new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9),
  235. new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9),
  236. new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9),
  237. new SqlParameter("@ExpandDatField1", SqlDbType.DateTime),
  238. new SqlParameter("@ExpandDatField2", SqlDbType.DateTime),
  239. new SqlParameter("@ExpandDatField3", SqlDbType.DateTime),
  240. new SqlParameter("@ExpandDatField4", SqlDbType.DateTime),
  241. new SqlParameter("@ExpandDatField5", SqlDbType.DateTime),
  242. new SqlParameter("@ExpandDatField6", SqlDbType.DateTime),
  243. new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200),
  244. new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200),
  245. new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200),
  246. new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200),
  247. new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200),
  248. new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200),
  249. new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200),
  250. new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200),
  251. new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200),
  252. new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500),
  253. new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500),
  254. new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000),
  255. new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000),
  256. new SqlParameter("@ExpandVchField14", SqlDbType.Text),
  257. new SqlParameter("@ExpandVchField15", SqlDbType.Text),
  258. new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2),
  259. new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2),
  260. new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2),
  261. new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2),
  262. new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2),
  263. new SqlParameter("@F_HJJGId", SqlDbType.Int),
  264. new SqlParameter("@F_YHFKID", SqlDbType.Int),
  265. new SqlParameter("@F_Remark", SqlDbType.NVarChar,300),
  266. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  267. parameters[0].Value = model.F_TaskId;
  268. parameters[1].Value = model.F_Phone;
  269. parameters[2].Value = model.F_Customer;
  270. parameters[3].Value = model.F_PhoneBy;
  271. parameters[4].Value = model.F_Sex;
  272. parameters[5].Value = model.F_FPState;
  273. parameters[6].Value = model.F_YJState;
  274. parameters[7].Value = model.F_HCState;
  275. parameters[8].Value = model.F_UserId;
  276. parameters[9].Value = model.F_UserName;
  277. parameters[10].Value = model.F_CreateTime;
  278. parameters[11].Value = model.ExpandIntField1;
  279. parameters[12].Value = model.ExpandIntField2;
  280. parameters[13].Value = model.ExpandIntField3;
  281. parameters[14].Value = model.ExpandIntField4;
  282. parameters[15].Value = model.ExpandIntField5;
  283. parameters[16].Value = model.ExpandIntField6;
  284. parameters[17].Value = model.ExpandDecField1;
  285. parameters[18].Value = model.ExpandDecField2;
  286. parameters[19].Value = model.ExpandDecField3;
  287. parameters[20].Value = model.ExpandDecField4;
  288. parameters[21].Value = model.ExpandDecField5;
  289. parameters[22].Value = model.ExpandDecField6;
  290. parameters[23].Value = model.ExpandDatField1;
  291. parameters[24].Value = model.ExpandDatField2;
  292. parameters[25].Value = model.ExpandDatField3;
  293. parameters[26].Value = model.ExpandDatField4;
  294. parameters[27].Value = model.ExpandDatField5;
  295. parameters[28].Value = model.ExpandDatField6;
  296. parameters[29].Value = model.ExpandVchField1;
  297. parameters[30].Value = model.ExpandVchField2;
  298. parameters[31].Value = model.ExpandVchField3;
  299. parameters[32].Value = model.ExpandVchField4;
  300. parameters[33].Value = model.ExpandVchField5;
  301. parameters[34].Value = model.ExpandVchField6;
  302. parameters[35].Value = model.ExpandVchField7;
  303. parameters[36].Value = model.ExpandVchField8;
  304. parameters[37].Value = model.ExpandVchField9;
  305. parameters[38].Value = model.ExpandVchField10;
  306. parameters[39].Value = model.ExpandVchField11;
  307. parameters[40].Value = model.ExpandVchField12;
  308. parameters[41].Value = model.ExpandVchField13;
  309. parameters[42].Value = model.ExpandVchField14;
  310. parameters[43].Value = model.ExpandVchField15;
  311. parameters[44].Value = model.ExpandSintField1;
  312. parameters[45].Value = model.ExpandSintField2;
  313. parameters[46].Value = model.ExpandSintField3;
  314. parameters[47].Value = model.ExpandSintField4;
  315. parameters[48].Value = model.ExpandSintField5;
  316. parameters[49].Value = model.F_HJJGId;
  317. parameters[50].Value = model.F_YHFKID;
  318. parameters[51].Value = model.F_Remark;
  319. parameters[52].Value = model.F_Id;
  320. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  321. if (rows > 0)
  322. {
  323. return true;
  324. }
  325. else
  326. {
  327. return false;
  328. }
  329. }
  330. /// <summary>
  331. /// 更新一条数据
  332. /// </summary>
  333. public bool Update(string ids)
  334. {
  335. string sql = $"Update T_Call_TaskTelNum set F_FPState=0, F_UserId=0,F_UserName=null where F_Id in ({ids})";
  336. return DbHelperSQL.ExecuteSql(sql) > 0;
  337. }
  338. /// <summary>
  339. /// 更新一条数据
  340. /// </summary>
  341. public bool UpdateFP(int id, int userid, string username)
  342. {
  343. StringBuilder strSql = new StringBuilder();
  344. strSql.Append("update T_Call_TaskTelNum set ");
  345. strSql.Append("F_FPState=1,");
  346. strSql.Append("F_UserId=@F_UserId,");
  347. strSql.Append("F_UserName=@F_UserName");
  348. strSql.Append(" where F_Id=@F_Id");
  349. SqlParameter[] parameters = {
  350. new SqlParameter("@F_UserId", SqlDbType.Int,4),
  351. new SqlParameter("@F_UserName", SqlDbType.VarChar,50),
  352. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  353. parameters[0].Value = userid;
  354. parameters[1].Value = username;
  355. parameters[2].Value = id;
  356. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  357. if (rows > 0)
  358. {
  359. return true;
  360. }
  361. else
  362. {
  363. return false;
  364. }
  365. }
  366. /// <summary>
  367. /// 更新一条数据
  368. /// </summary>
  369. public bool UpdateHJJG(int id, int resid, string name)
  370. {
  371. StringBuilder strSql = new StringBuilder();
  372. strSql.Append("update T_Call_TaskTelNum set ");
  373. strSql.Append("F_HJJGId=@F_HJJGId,");
  374. strSql.Append("F_HJJGName=@F_HJJGName");
  375. strSql.Append(" where F_Id=@F_Id");
  376. SqlParameter[] parameters = {
  377. new SqlParameter("@F_HJJGId", SqlDbType.Int,4),
  378. new SqlParameter("@F_HJJGName", SqlDbType.VarChar,500),
  379. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  380. parameters[0].Value = resid;
  381. parameters[1].Value = name;
  382. parameters[2].Value = id;
  383. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  384. if (rows > 0)
  385. {
  386. return true;
  387. }
  388. else
  389. {
  390. return false;
  391. }
  392. }
  393. /// <summary>
  394. /// 更新一条数据
  395. /// </summary>
  396. public bool UpdateQXFP(string arrid)
  397. {
  398. StringBuilder strSql = new StringBuilder();
  399. strSql.Append("update T_Call_TaskTelNum set ");
  400. strSql.Append("F_FPState=0,");
  401. strSql.Append("F_UserId=0,");
  402. strSql.Append("F_UserName=''");
  403. strSql.Append(" where F_Id in (" + arrid + ")");
  404. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  405. if (rows > 0)
  406. {
  407. return true;
  408. }
  409. else
  410. {
  411. return false;
  412. }
  413. }
  414. /// <summary>
  415. /// 更新一条数据
  416. /// </summary>
  417. public bool UpdateHC(int id, int state)
  418. {
  419. StringBuilder strSql = new StringBuilder();
  420. strSql.Append("update T_Call_TaskTelNum set ");
  421. strSql.Append("F_HCState=@F_HCState");
  422. strSql.Append(" where F_Id=@F_Id");
  423. SqlParameter[] parameters = {
  424. new SqlParameter("@F_HCState", SqlDbType.Int,4),
  425. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  426. parameters[0].Value = state;
  427. parameters[1].Value = id;
  428. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  429. if (rows > 0)
  430. {
  431. return true;
  432. }
  433. else
  434. {
  435. return false;
  436. }
  437. }
  438. /// <summary>
  439. /// 更新一条数据
  440. /// </summary>
  441. public bool UpdateYJ(int id, int state)
  442. {
  443. StringBuilder strSql = new StringBuilder();
  444. strSql.Append("update T_Call_TaskTelNum set ");
  445. strSql.Append("F_YJState=@F_YJState");
  446. strSql.Append(" where F_Id=@F_Id");
  447. SqlParameter[] parameters = {
  448. new SqlParameter("@F_YJState", SqlDbType.Int,4),
  449. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  450. parameters[0].Value = state;
  451. parameters[1].Value = id;
  452. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  453. if (rows > 0)
  454. {
  455. return true;
  456. }
  457. else
  458. {
  459. return false;
  460. }
  461. }
  462. /// <summary>
  463. /// 更新一条数据
  464. /// </summary>
  465. public bool UpdateAsk(CallCenterApi.Model.T_Call_TaskTelNum model)
  466. {
  467. StringBuilder strSql = new StringBuilder();
  468. strSql.Append("update T_Call_TaskTelNum set ");
  469. strSql.Append("F_AskInfo=@F_AskInfo,");
  470. strSql.Append("F_AskRes=@F_AskRes");
  471. strSql.Append(" where F_Id=@F_Id");
  472. SqlParameter[] parameters = {
  473. new SqlParameter("@F_AskInfo", SqlDbType.Text),
  474. new SqlParameter("@F_AskRes", SqlDbType.Text),
  475. new SqlParameter("@F_Id", SqlDbType.Int,4)};
  476. parameters[0].Value = model.F_AskInfo;
  477. parameters[1].Value = model.F_AskRes;
  478. parameters[2].Value = model.F_Id;
  479. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  480. if (rows > 0)
  481. {
  482. return true;
  483. }
  484. else
  485. {
  486. return false;
  487. }
  488. }
  489. /// <summary>
  490. /// 删除一条数据
  491. /// </summary>
  492. public bool Delete(int F_Id)
  493. {
  494. StringBuilder strSql = new StringBuilder();
  495. strSql.Append("delete from T_Call_TaskTelNum ");
  496. strSql.Append(" where F_Id=@F_Id");
  497. SqlParameter[] parameters = {
  498. new SqlParameter("@F_Id", SqlDbType.Int,4)
  499. };
  500. parameters[0].Value = F_Id;
  501. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  502. if (rows > 0)
  503. {
  504. return true;
  505. }
  506. else
  507. {
  508. return false;
  509. }
  510. }
  511. /// <summary>
  512. /// 删除一条数据
  513. /// </summary>
  514. public int ClearPhone(int F_Id)
  515. {
  516. StringBuilder strSql = new StringBuilder();
  517. strSql.Append("delete from T_Call_TaskTelNum ");
  518. strSql.Append(" where F_TaskId=@F_TaskId and F_FPState=0 ");
  519. SqlParameter[] parameters = {
  520. new SqlParameter("@F_TaskId", SqlDbType.Int,4)
  521. };
  522. parameters[0].Value = F_Id;
  523. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  524. return rows;
  525. }
  526. /// <summary>
  527. /// 批量删除数据
  528. /// </summary>
  529. public bool DeleteList(string F_Idlist)
  530. {
  531. StringBuilder strSql = new StringBuilder();
  532. strSql.Append("delete from T_Call_TaskTelNum ");
  533. strSql.Append(" where F_Id in (" + F_Idlist + ") ");
  534. int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
  535. if (rows > 0)
  536. {
  537. return true;
  538. }
  539. else
  540. {
  541. return false;
  542. }
  543. }
  544. /// <summary>
  545. /// 删除指定任务下所有号码
  546. /// </summary>
  547. public int DeletePhoneByTaskId(long id)
  548. {
  549. StringBuilder strSql = new StringBuilder();
  550. strSql.Append("delete from T_Call_TaskTelNum ");
  551. strSql.Append(" where F_TaskId=@F_TaskId");
  552. SqlParameter[] parameters = {
  553. new SqlParameter("@F_TaskId", SqlDbType.Int,4)
  554. };
  555. parameters[0].Value = id;
  556. int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
  557. return rows;
  558. }
  559. /// <summary>
  560. /// 得到一个对象实体
  561. /// </summary>
  562. public CallCenterApi.Model.T_Call_TaskTelNum GetModel(int F_Id)
  563. {
  564. StringBuilder strSql = new StringBuilder();
  565. strSql.Append("select top 1 * from T_Call_TaskTelNum ");
  566. strSql.Append(" where F_Id=@F_Id");
  567. SqlParameter[] parameters = {
  568. new SqlParameter("@F_Id", SqlDbType.Int,4)
  569. };
  570. parameters[0].Value = F_Id;
  571. CallCenterApi.Model.T_Call_TaskTelNum model = new CallCenterApi.Model.T_Call_TaskTelNum();
  572. DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
  573. if (ds.Tables[0].Rows.Count > 0)
  574. {
  575. if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "")
  576. {
  577. model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString());
  578. }
  579. if (ds.Tables[0].Rows[0]["F_TaskId"] != null && ds.Tables[0].Rows[0]["F_TaskId"].ToString() != "")
  580. {
  581. model.F_TaskId = int.Parse(ds.Tables[0].Rows[0]["F_TaskId"].ToString());
  582. }
  583. if (ds.Tables[0].Rows[0]["F_Phone"] != null && ds.Tables[0].Rows[0]["F_Phone"].ToString() != "")
  584. {
  585. model.F_Phone = ds.Tables[0].Rows[0]["F_Phone"].ToString();
  586. }
  587. if (ds.Tables[0].Rows[0]["F_Customer"] != null && ds.Tables[0].Rows[0]["F_Customer"].ToString() != "")
  588. {
  589. model.F_Customer = ds.Tables[0].Rows[0]["F_Customer"].ToString();
  590. }
  591. if (ds.Tables[0].Rows[0]["F_PhoneBy"] != null && ds.Tables[0].Rows[0]["F_PhoneBy"].ToString() != "")
  592. {
  593. model.F_PhoneBy = ds.Tables[0].Rows[0]["F_PhoneBy"].ToString();
  594. }
  595. if (ds.Tables[0].Rows[0]["F_Sex"] != null && ds.Tables[0].Rows[0]["F_Sex"].ToString() != "")
  596. {
  597. model.F_Sex = ds.Tables[0].Rows[0]["F_Sex"].ToString();
  598. }
  599. if (ds.Tables[0].Rows[0]["F_FPState"] != null && ds.Tables[0].Rows[0]["F_FPState"].ToString() != "")
  600. {
  601. model.F_FPState = int.Parse(ds.Tables[0].Rows[0]["F_FPState"].ToString());
  602. }
  603. if (ds.Tables[0].Rows[0]["F_YJState"] != null && ds.Tables[0].Rows[0]["F_YJState"].ToString() != "")
  604. {
  605. model.F_YJState = int.Parse(ds.Tables[0].Rows[0]["F_YJState"].ToString());
  606. }
  607. if (ds.Tables[0].Rows[0]["F_HCState"] != null && ds.Tables[0].Rows[0]["F_HCState"].ToString() != "")
  608. {
  609. model.F_HCState = int.Parse(ds.Tables[0].Rows[0]["F_HCState"].ToString());
  610. }
  611. if (ds.Tables[0].Rows[0]["F_UserId"] != null && ds.Tables[0].Rows[0]["F_UserId"].ToString() != "")
  612. {
  613. model.F_UserId = int.Parse(ds.Tables[0].Rows[0]["F_UserId"].ToString());
  614. }
  615. if (ds.Tables[0].Rows[0]["F_UserName"] != null && ds.Tables[0].Rows[0]["F_UserName"].ToString() != "")
  616. {
  617. model.F_UserName = ds.Tables[0].Rows[0]["F_UserName"].ToString();
  618. }
  619. if (ds.Tables[0].Rows[0]["F_CreateTime"] != null && ds.Tables[0].Rows[0]["F_CreateTime"].ToString() != "")
  620. {
  621. model.F_CreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["F_CreateTime"].ToString());
  622. }
  623. if (ds.Tables[0].Rows[0]["ExpandIntField1"] != null && ds.Tables[0].Rows[0]["ExpandIntField1"].ToString() != "")
  624. {
  625. model.ExpandIntField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField1"].ToString());
  626. }
  627. if (ds.Tables[0].Rows[0]["ExpandIntField2"] != null && ds.Tables[0].Rows[0]["ExpandIntField2"].ToString() != "")
  628. {
  629. model.ExpandIntField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField2"].ToString());
  630. }
  631. if (ds.Tables[0].Rows[0]["ExpandIntField3"] != null && ds.Tables[0].Rows[0]["ExpandIntField3"].ToString() != "")
  632. {
  633. model.ExpandIntField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField3"].ToString());
  634. }
  635. if (ds.Tables[0].Rows[0]["ExpandIntField4"] != null && ds.Tables[0].Rows[0]["ExpandIntField4"].ToString() != "")
  636. {
  637. model.ExpandIntField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField4"].ToString());
  638. }
  639. if (ds.Tables[0].Rows[0]["ExpandIntField5"] != null && ds.Tables[0].Rows[0]["ExpandIntField5"].ToString() != "")
  640. {
  641. model.ExpandIntField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField5"].ToString());
  642. }
  643. if (ds.Tables[0].Rows[0]["ExpandIntField6"] != null && ds.Tables[0].Rows[0]["ExpandIntField6"].ToString() != "")
  644. {
  645. model.ExpandIntField6 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField6"].ToString());
  646. }
  647. if (ds.Tables[0].Rows[0]["ExpandDecField1"] != null && ds.Tables[0].Rows[0]["ExpandDecField1"].ToString() != "")
  648. {
  649. model.ExpandDecField1 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField1"].ToString());
  650. }
  651. if (ds.Tables[0].Rows[0]["ExpandDecField2"] != null && ds.Tables[0].Rows[0]["ExpandDecField2"].ToString() != "")
  652. {
  653. model.ExpandDecField2 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField2"].ToString());
  654. }
  655. if (ds.Tables[0].Rows[0]["ExpandDecField3"] != null && ds.Tables[0].Rows[0]["ExpandDecField3"].ToString() != "")
  656. {
  657. model.ExpandDecField3 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField3"].ToString());
  658. }
  659. if (ds.Tables[0].Rows[0]["ExpandDecField4"] != null && ds.Tables[0].Rows[0]["ExpandDecField4"].ToString() != "")
  660. {
  661. model.ExpandDecField4 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField4"].ToString());
  662. }
  663. if (ds.Tables[0].Rows[0]["ExpandDecField5"] != null && ds.Tables[0].Rows[0]["ExpandDecField5"].ToString() != "")
  664. {
  665. model.ExpandDecField5 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField5"].ToString());
  666. }
  667. if (ds.Tables[0].Rows[0]["ExpandDecField6"] != null && ds.Tables[0].Rows[0]["ExpandDecField6"].ToString() != "")
  668. {
  669. model.ExpandDecField6 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField6"].ToString());
  670. }
  671. if (ds.Tables[0].Rows[0]["ExpandDatField1"] != null && ds.Tables[0].Rows[0]["ExpandDatField1"].ToString() != "")
  672. {
  673. model.ExpandDatField1 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField1"].ToString());
  674. }
  675. if (ds.Tables[0].Rows[0]["ExpandDatField2"] != null && ds.Tables[0].Rows[0]["ExpandDatField2"].ToString() != "")
  676. {
  677. model.ExpandDatField2 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField2"].ToString());
  678. }
  679. if (ds.Tables[0].Rows[0]["ExpandDatField3"] != null && ds.Tables[0].Rows[0]["ExpandDatField3"].ToString() != "")
  680. {
  681. model.ExpandDatField3 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField3"].ToString());
  682. }
  683. if (ds.Tables[0].Rows[0]["ExpandDatField4"] != null && ds.Tables[0].Rows[0]["ExpandDatField4"].ToString() != "")
  684. {
  685. model.ExpandDatField4 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField4"].ToString());
  686. }
  687. if (ds.Tables[0].Rows[0]["ExpandDatField5"] != null && ds.Tables[0].Rows[0]["ExpandDatField5"].ToString() != "")
  688. {
  689. model.ExpandDatField5 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField5"].ToString());
  690. }
  691. if (ds.Tables[0].Rows[0]["ExpandDatField6"] != null && ds.Tables[0].Rows[0]["ExpandDatField6"].ToString() != "")
  692. {
  693. model.ExpandDatField6 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField6"].ToString());
  694. }
  695. if (ds.Tables[0].Rows[0]["ExpandVchField1"] != null && ds.Tables[0].Rows[0]["ExpandVchField1"].ToString() != "")
  696. {
  697. model.ExpandVchField1 = ds.Tables[0].Rows[0]["ExpandVchField1"].ToString();
  698. }
  699. if (ds.Tables[0].Rows[0]["ExpandVchField2"] != null && ds.Tables[0].Rows[0]["ExpandVchField2"].ToString() != "")
  700. {
  701. model.ExpandVchField2 = ds.Tables[0].Rows[0]["ExpandVchField2"].ToString();
  702. }
  703. if (ds.Tables[0].Rows[0]["ExpandVchField3"] != null && ds.Tables[0].Rows[0]["ExpandVchField3"].ToString() != "")
  704. {
  705. model.ExpandVchField3 = ds.Tables[0].Rows[0]["ExpandVchField3"].ToString();
  706. }
  707. if (ds.Tables[0].Rows[0]["ExpandVchField4"] != null && ds.Tables[0].Rows[0]["ExpandVchField4"].ToString() != "")
  708. {
  709. model.ExpandVchField4 = ds.Tables[0].Rows[0]["ExpandVchField4"].ToString();
  710. }
  711. if (ds.Tables[0].Rows[0]["ExpandVchField5"] != null && ds.Tables[0].Rows[0]["ExpandVchField5"].ToString() != "")
  712. {
  713. model.ExpandVchField5 = ds.Tables[0].Rows[0]["ExpandVchField5"].ToString();
  714. }
  715. if (ds.Tables[0].Rows[0]["ExpandVchField6"] != null && ds.Tables[0].Rows[0]["ExpandVchField6"].ToString() != "")
  716. {
  717. model.ExpandVchField6 = ds.Tables[0].Rows[0]["ExpandVchField6"].ToString();
  718. }
  719. if (ds.Tables[0].Rows[0]["ExpandVchField7"] != null && ds.Tables[0].Rows[0]["ExpandVchField7"].ToString() != "")
  720. {
  721. model.ExpandVchField7 = ds.Tables[0].Rows[0]["ExpandVchField7"].ToString();
  722. }
  723. if (ds.Tables[0].Rows[0]["ExpandVchField8"] != null && ds.Tables[0].Rows[0]["ExpandVchField8"].ToString() != "")
  724. {
  725. model.ExpandVchField8 = ds.Tables[0].Rows[0]["ExpandVchField8"].ToString();
  726. }
  727. if (ds.Tables[0].Rows[0]["ExpandVchField9"] != null && ds.Tables[0].Rows[0]["ExpandVchField9"].ToString() != "")
  728. {
  729. model.ExpandVchField9 = ds.Tables[0].Rows[0]["ExpandVchField9"].ToString();
  730. }
  731. if (ds.Tables[0].Rows[0]["ExpandVchField10"] != null && ds.Tables[0].Rows[0]["ExpandVchField10"].ToString() != "")
  732. {
  733. model.ExpandVchField10 = ds.Tables[0].Rows[0]["ExpandVchField10"].ToString();
  734. }
  735. if (ds.Tables[0].Rows[0]["ExpandVchField11"] != null && ds.Tables[0].Rows[0]["ExpandVchField11"].ToString() != "")
  736. {
  737. model.ExpandVchField11 = ds.Tables[0].Rows[0]["ExpandVchField11"].ToString();
  738. }
  739. if (ds.Tables[0].Rows[0]["ExpandVchField12"] != null && ds.Tables[0].Rows[0]["ExpandVchField12"].ToString() != "")
  740. {
  741. model.ExpandVchField12 = ds.Tables[0].Rows[0]["ExpandVchField12"].ToString();
  742. }
  743. if (ds.Tables[0].Rows[0]["ExpandVchField13"] != null && ds.Tables[0].Rows[0]["ExpandVchField13"].ToString() != "")
  744. {
  745. model.ExpandVchField13 = ds.Tables[0].Rows[0]["ExpandVchField13"].ToString();
  746. }
  747. if (ds.Tables[0].Rows[0]["ExpandVchField14"] != null && ds.Tables[0].Rows[0]["ExpandVchField14"].ToString() != "")
  748. {
  749. model.ExpandVchField14 = ds.Tables[0].Rows[0]["ExpandVchField14"].ToString();
  750. }
  751. if (ds.Tables[0].Rows[0]["ExpandVchField15"] != null && ds.Tables[0].Rows[0]["ExpandVchField15"].ToString() != "")
  752. {
  753. model.ExpandVchField15 = ds.Tables[0].Rows[0]["ExpandVchField15"].ToString();
  754. }
  755. if (ds.Tables[0].Rows[0]["ExpandSintField1"] != null && ds.Tables[0].Rows[0]["ExpandSintField1"].ToString() != "")
  756. {
  757. model.ExpandSintField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField1"].ToString());
  758. }
  759. if (ds.Tables[0].Rows[0]["ExpandSintField2"] != null && ds.Tables[0].Rows[0]["ExpandSintField2"].ToString() != "")
  760. {
  761. model.ExpandSintField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField2"].ToString());
  762. }
  763. if (ds.Tables[0].Rows[0]["ExpandSintField3"] != null && ds.Tables[0].Rows[0]["ExpandSintField3"].ToString() != "")
  764. {
  765. model.ExpandSintField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField3"].ToString());
  766. }
  767. if (ds.Tables[0].Rows[0]["ExpandSintField4"] != null && ds.Tables[0].Rows[0]["ExpandSintField4"].ToString() != "")
  768. {
  769. model.ExpandSintField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField4"].ToString());
  770. }
  771. if (ds.Tables[0].Rows[0]["ExpandSintField5"] != null && ds.Tables[0].Rows[0]["ExpandSintField5"].ToString() != "")
  772. {
  773. model.ExpandSintField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField5"].ToString());
  774. }
  775. if (ds.Tables[0].Rows[0]["F_AskInfo"] != null && ds.Tables[0].Rows[0]["F_AskInfo"].ToString() != "")
  776. {
  777. model.F_AskInfo = ds.Tables[0].Rows[0]["F_AskInfo"].ToString();
  778. }
  779. if (ds.Tables[0].Rows[0]["F_AskRes"] != null && ds.Tables[0].Rows[0]["F_AskRes"].ToString() != "")
  780. {
  781. model.F_AskRes = ds.Tables[0].Rows[0]["F_AskRes"].ToString();
  782. }
  783. model.F_HJJGId = ds.Tables[0].Rows[0]["F_AskRes"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["F_AskRes"]);
  784. model.F_YHFKID = ds.Tables[0].Rows[0]["F_YHFKID"] == DBNull.Value ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["F_YHFKID"]);
  785. model.F_Remark = ds.Tables[0].Rows[0]["F_Remark"] == DBNull.Value ? "" : ds.Tables[0].Rows[0]["F_Remark"].ToString();
  786. model.F_HJJGName = ds.Tables[0].Rows[0]["F_HJJGName"] == DBNull.Value ? "" : ds.Tables[0].Rows[0]["F_HJJGName"].ToString();
  787. model.F_YHFKName = ds.Tables[0].Rows[0]["F_YHFKName"] == DBNull.Value ? "" : ds.Tables[0].Rows[0]["F_YHFKName"].ToString();
  788. return model;
  789. }
  790. else
  791. {
  792. return null;
  793. }
  794. }
  795. /// <summary>
  796. /// 获得数据列表
  797. /// </summary>
  798. public DataSet GetList(string strWhere)
  799. {
  800. StringBuilder strSql = new StringBuilder();
  801. strSql.Append("select * ");
  802. strSql.Append(" FROM T_Call_TaskTelNum ");
  803. if (strWhere.Trim() != "")
  804. {
  805. strSql.Append(" where " + strWhere);
  806. }
  807. return DbHelperSQL.Query(strSql.ToString());
  808. }
  809. /// <summary>
  810. /// 获得前几行数据
  811. /// </summary>
  812. public DataSet GetList(int Top, string strWhere, string filedOrder)
  813. {
  814. StringBuilder strSql = new StringBuilder();
  815. strSql.Append("select ");
  816. if (Top > 0)
  817. {
  818. strSql.Append(" top " + Top.ToString());
  819. }
  820. 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 ");
  821. strSql.Append(" FROM T_Call_TaskTelNum ");
  822. if (strWhere.Trim() != "")
  823. {
  824. strSql.Append(" where " + strWhere);
  825. }
  826. strSql.Append(" order by " + filedOrder);
  827. return DbHelperSQL.Query(strSql.ToString());
  828. }
  829. public DataSet GetPhoneList(string strWhere)
  830. {
  831. StringBuilder strSql = new StringBuilder();
  832. strSql.Append("select F_Phone ");
  833. strSql.Append(" FROM T_Call_TaskTelNum ");
  834. if (strWhere.Trim() != "")
  835. {
  836. strSql.Append(" where " + strWhere);
  837. }
  838. return DbHelperSQL.Query(strSql.ToString());
  839. }
  840. /// <summary>
  841. /// 获取记录总数
  842. /// </summary>
  843. public int GetRecordCount(string strWhere)
  844. {
  845. StringBuilder strSql = new StringBuilder();
  846. strSql.Append("select count(1) FROM T_Call_TaskTelNum ");
  847. if (strWhere.Trim() != "")
  848. {
  849. strSql.Append(" where " + strWhere);
  850. }
  851. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  852. if (obj == null)
  853. {
  854. return 0;
  855. }
  856. else
  857. {
  858. return Convert.ToInt32(obj);
  859. }
  860. }
  861. /// <summary>
  862. /// 分页获取数据列表
  863. /// </summary>
  864. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  865. {
  866. StringBuilder strSql = new StringBuilder();
  867. strSql.Append("SELECT * FROM ( ");
  868. strSql.Append(" SELECT ROW_NUMBER() OVER (");
  869. if (!string.IsNullOrEmpty(orderby.Trim()))
  870. {
  871. strSql.Append("order by T." + orderby);
  872. }
  873. else
  874. {
  875. strSql.Append("order by T.F_Id desc");
  876. }
  877. strSql.Append(")AS Row, T.* from T_Call_TaskTelNum T ");
  878. if (!string.IsNullOrEmpty(strWhere.Trim()))
  879. {
  880. strSql.Append(" WHERE " + strWhere);
  881. }
  882. strSql.Append(" ) TT");
  883. strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
  884. return DbHelperSQL.Query(strSql.ToString());
  885. }
  886. /// <summary>
  887. /// 获取表结构
  888. /// </summary>
  889. /// <returns></returns>
  890. public DataTable GetTableDesign()
  891. {
  892. return DbHelperSQL.Query("SET FMTONLY ON;SELECT * FROM T_Call_TaskTelNum ;SET FMTONLY OFF; ").Tables[0];
  893. }
  894. /// <summary>
  895. /// 大量数据导入SqlBulkCopy
  896. /// </summary>
  897. /// <returns></returns>
  898. public void SqlBulkCopy(DataTable dt)
  899. {
  900. DbHelperSQL.SqlBulkCopyByDatatable("T_Call_TaskTelNum", dt);
  901. }
  902. /*
  903. /// <summary>
  904. /// 分页获取数据列表
  905. /// </summary>
  906. public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  907. {
  908. SqlParameter[] parameters = {
  909. new SqlParameter("@tblName", SqlDbType.VarChar, 255),
  910. new SqlParameter("@fldName", SqlDbType.VarChar, 255),
  911. new SqlParameter("@PageSize", SqlDbType.Int),
  912. new SqlParameter("@PageIndex", SqlDbType.Int),
  913. new SqlParameter("@IsReCount", SqlDbType.Bit),
  914. new SqlParameter("@OrderType", SqlDbType.Bit),
  915. new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
  916. };
  917. parameters[0].Value = "T_Call_TaskTelNum";
  918. parameters[1].Value = "F_Id";
  919. parameters[2].Value = PageSize;
  920. parameters[3].Value = PageIndex;
  921. parameters[4].Value = 0;
  922. parameters[5].Value = 0;
  923. parameters[6].Value = strWhere;
  924. return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
  925. }*/
  926. #endregion Method
  927. }
  928. }