鄂尔多斯-招源科技

T_Call_TaskTelNum.cs 49KB

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