鹤壁市长热线,前端git:http://192.168.1.222:3000/clq1010/CallCenter5.0WebUI.git 中的鹤壁12345分支

T_CTI_Task.cs 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Data;
  6. namespace CallCenterApi.BLL
  7. {
  8. /// <summary>
  9. /// 计划表
  10. /// </summary>
  11. public partial class T_CTI_Task
  12. {
  13. private readonly CallCenterApi.DAL.T_CTI_Task dal = new CallCenterApi.DAL.T_CTI_Task();
  14. public T_CTI_Task()
  15. { }
  16. #region Method
  17. /// <summary>
  18. /// 是否存在该记录
  19. /// </summary>
  20. public bool Exists(long TaskID)
  21. {
  22. return dal.Exists(TaskID);
  23. }
  24. /// <summary>
  25. /// 增加一条数据
  26. /// </summary>
  27. public long Add(CallCenterApi.Model.T_CTI_Task model)
  28. {
  29. return dal.Add(model);
  30. }
  31. /// <summary>
  32. /// 更新一条数据
  33. /// </summary>
  34. public bool Update(CallCenterApi.Model.T_CTI_Task model)
  35. {
  36. return dal.Update(model);
  37. }
  38. /// <summary>
  39. /// 更新一条数据
  40. /// </summary>
  41. public bool UpdateState(int id, int state)
  42. {
  43. return dal.UpdateState(id, state);
  44. }
  45. /// <summary>
  46. /// 更新多条数据
  47. /// </summary>
  48. public bool UpdateStateBatch(string where, int state)
  49. {
  50. return dal.UpdateStateBatch(where, state);
  51. }
  52. /// <summary>
  53. /// 删除一条数据
  54. /// </summary>
  55. public bool Delete(long TaskID)
  56. {
  57. return dal.Delete(TaskID);
  58. }
  59. /// <summary>
  60. /// 删除一条数据
  61. /// </summary>
  62. public bool DeleteList(string TaskIDlist)
  63. {
  64. return dal.DeleteList(TaskIDlist);
  65. }
  66. /// <summary>
  67. /// 得到一个对象实体
  68. /// </summary>
  69. public CallCenterApi.Model.T_CTI_Task GetModel(long TaskID)
  70. {
  71. return dal.GetModel(TaskID);
  72. }
  73. /// <summary>
  74. /// 获得数据列表
  75. /// </summary>
  76. public DataSet GetList(string strWhere)
  77. {
  78. return dal.GetList(strWhere);
  79. }
  80. /// <summary>
  81. /// 获得前几行数据
  82. /// </summary>
  83. public DataSet GetList(int Top, string strWhere, string filedOrder)
  84. {
  85. return dal.GetList(Top, strWhere, filedOrder);
  86. }
  87. /// <summary>
  88. /// 获得数据列表
  89. /// </summary>
  90. public List<CallCenterApi.Model.T_CTI_Task> GetModelList(string strWhere)
  91. {
  92. DataSet ds = dal.GetList(strWhere);
  93. return DataTableToList(ds.Tables[0]);
  94. }
  95. /// <summary>
  96. /// 获得数据列表
  97. /// </summary>
  98. public List<CallCenterApi.Model.T_CTI_Task> DataTableToList(DataTable dt)
  99. {
  100. List<CallCenterApi.Model.T_CTI_Task> modelList = new List<CallCenterApi.Model.T_CTI_Task>();
  101. int rowsCount = dt.Rows.Count;
  102. if (rowsCount > 0)
  103. {
  104. CallCenterApi.Model.T_CTI_Task model;
  105. for (int n = 0; n < rowsCount; n++)
  106. {
  107. model = new CallCenterApi.Model.T_CTI_Task();
  108. if (dt.Rows[n]["TaskID"] != null && dt.Rows[n]["TaskID"].ToString() != "")
  109. {
  110. model.TaskID = long.Parse(dt.Rows[n]["TaskID"].ToString());
  111. }
  112. if (dt.Rows[n]["TaskName"] != null && dt.Rows[n]["TaskName"].ToString() != "")
  113. {
  114. model.TaskName = dt.Rows[n]["TaskName"].ToString();
  115. }
  116. if (dt.Rows[n]["TrunkGroupID"] != null && dt.Rows[n]["TrunkGroupID"].ToString() != "")
  117. {
  118. model.TrunkGroupID = int.Parse(dt.Rows[n]["TrunkGroupID"].ToString());
  119. }
  120. if (dt.Rows[n]["CallerNum"] != null && dt.Rows[n]["CallerNum"].ToString() != "")
  121. {
  122. model.CallerNum = dt.Rows[n]["CallerNum"].ToString();
  123. }
  124. if (dt.Rows[n]["CallType"] != null && dt.Rows[n]["CallType"].ToString() != "")
  125. {
  126. model.CallType = int.Parse(dt.Rows[n]["CallType"].ToString());
  127. }
  128. if (dt.Rows[n]["ExInfo"] != null && dt.Rows[n]["ExInfo"].ToString() != "")
  129. {
  130. model.ExInfo = dt.Rows[n]["ExInfo"].ToString();
  131. }
  132. if (dt.Rows[n]["MaxTrunkCount"] != null && dt.Rows[n]["MaxTrunkCount"].ToString() != "")
  133. {
  134. model.MaxTrunkCount = int.Parse(dt.Rows[n]["MaxTrunkCount"].ToString());
  135. }
  136. if (dt.Rows[n]["IntensityCoefficient"] != null && dt.Rows[n]["IntensityCoefficient"].ToString() != "")
  137. {
  138. model.IntensityCoefficient = decimal.Parse(dt.Rows[n]["IntensityCoefficient"].ToString());
  139. }
  140. if (dt.Rows[n]["ItemTableName"] != null && dt.Rows[n]["ItemTableName"].ToString() != "")
  141. {
  142. model.ItemTableName = dt.Rows[n]["ItemTableName"].ToString();
  143. }
  144. if (dt.Rows[n]["State"] != null && dt.Rows[n]["State"].ToString() != "")
  145. {
  146. model.State = int.Parse(dt.Rows[n]["State"].ToString());
  147. }
  148. if (dt.Rows[n]["AddTime"] != null && dt.Rows[n]["AddTime"].ToString() != "")
  149. {
  150. model.AddTime = DateTime.Parse(dt.Rows[n]["AddTime"].ToString());
  151. }
  152. if (dt.Rows[n]["y_PSort"] != null && dt.Rows[n]["y_PSort"].ToString() != "")
  153. {
  154. model.y_PSort = int.Parse(dt.Rows[n]["y_PSort"].ToString());
  155. }
  156. if (dt.Rows[n]["y_TkModelId"] != null && dt.Rows[n]["y_TkModelId"].ToString() != "")
  157. {
  158. model.y_TkModelId = long.Parse(dt.Rows[n]["y_TkModelId"].ToString());
  159. }
  160. if (dt.Rows[n]["y_SXH"] != null && dt.Rows[n]["y_SXH"].ToString() != "")
  161. {
  162. model.y_SXH = int.Parse(dt.Rows[n]["y_SXH"].ToString());
  163. }
  164. if (dt.Rows[n]["y_FPCount"] != null && dt.Rows[n]["y_FPCount"].ToString() != "")
  165. {
  166. model.y_FPCount = int.Parse(dt.Rows[n]["y_FPCount"].ToString());
  167. }
  168. if (dt.Rows[n]["y_YJCount"] != null && dt.Rows[n]["y_YJCount"].ToString() != "")
  169. {
  170. model.y_YJCount = int.Parse(dt.Rows[n]["y_YJCount"].ToString());
  171. }
  172. if (dt.Rows[n]["y_HCCount"] != null && dt.Rows[n]["y_HCCount"].ToString() != "")
  173. {
  174. model.y_HCCount = int.Parse(dt.Rows[n]["y_HCCount"].ToString());
  175. }
  176. if (dt.Rows[n]["y_HSCount"] != null && dt.Rows[n]["y_HSCount"].ToString() != "")
  177. {
  178. model.y_HSCount = int.Parse(dt.Rows[n]["y_HSCount"].ToString());
  179. }
  180. if (dt.Rows[n]["y_HTCount"] != null && dt.Rows[n]["y_HTCount"].ToString() != "")
  181. {
  182. model.y_HTCount = int.Parse(dt.Rows[n]["y_HTCount"].ToString());
  183. }
  184. if (dt.Rows[n]["y_HMCount"] != null && dt.Rows[n]["y_HMCount"].ToString() != "")
  185. {
  186. model.y_HMCount = int.Parse(dt.Rows[n]["y_HMCount"].ToString());
  187. }
  188. if (dt.Rows[n]["y_OkCount"] != null && dt.Rows[n]["y_OkCount"].ToString() != "")
  189. {
  190. model.y_OkCount = int.Parse(dt.Rows[n]["y_OkCount"].ToString());
  191. }
  192. if (dt.Rows[n]["y_RFCount"] != null && dt.Rows[n]["y_RFCount"].ToString() != "")
  193. {
  194. model.y_RFCount = int.Parse(dt.Rows[n]["y_RFCount"].ToString());
  195. }
  196. if (dt.Rows[n]["y_ConsCount"] != null && dt.Rows[n]["y_ConsCount"].ToString() != "")
  197. {
  198. model.y_ConsCount = int.Parse(dt.Rows[n]["y_ConsCount"].ToString());
  199. }
  200. if (dt.Rows[n]["y_InvlCount"] != null && dt.Rows[n]["y_InvlCount"].ToString() != "")
  201. {
  202. model.y_InvlCount = int.Parse(dt.Rows[n]["y_InvlCount"].ToString());
  203. }
  204. if (dt.Rows[n]["y_NoAnswerCount"] != null && dt.Rows[n]["y_NoAnswerCount"].ToString() != "")
  205. {
  206. model.y_NoAnswerCount = int.Parse(dt.Rows[n]["y_NoAnswerCount"].ToString());
  207. }
  208. if (dt.Rows[n]["y_ShutDownCount"] != null && dt.Rows[n]["y_ShutDownCount"].ToString() != "")
  209. {
  210. model.y_ShutDownCount = int.Parse(dt.Rows[n]["y_ShutDownCount"].ToString());
  211. }
  212. if (dt.Rows[n]["TaskType"] != null && dt.Rows[n]["TaskType"].ToString() != "")
  213. {
  214. model.TaskType = int.Parse(dt.Rows[n]["TaskType"].ToString());
  215. }
  216. modelList.Add(model);
  217. }
  218. }
  219. return modelList;
  220. }
  221. ///// <summary>
  222. ///// 获得数据列表
  223. ///// </summary>
  224. //public List<CallCenterApi.Model.vw_CTI_TaskPager> DataTableToListPager(DataTable dt)
  225. //{
  226. // List<CallCenterApi.Model.vw_CTI_TaskPager> modelList = new List<CallCenterApi.Model.vw_CTI_TaskPager>();
  227. // int rowsCount = dt.Rows.Count;
  228. // var columns = dt.Columns;
  229. // if (rowsCount > 0)
  230. // {
  231. // CallCenterApi.Model.vw_CTI_TaskPager model;
  232. // for (int n = 0; n < rowsCount; n++)
  233. // {
  234. // try
  235. // {
  236. // model = new CallCenterApi.Model.vw_CTI_TaskPager();
  237. // if (dt.Rows[n]["TaskID"] != null && dt.Rows[n]["TaskID"].ToString() != "")
  238. // {
  239. // model.TaskID = long.Parse(dt.Rows[n]["TaskID"].ToString());
  240. // }
  241. // if (dt.Rows[n]["TaskName"] != null && dt.Rows[n]["TaskName"].ToString() != "")
  242. // {
  243. // model.TaskName = dt.Rows[n]["TaskName"].ToString();
  244. // }
  245. // if (columns.Contains("TrunkGroupID"))
  246. // {
  247. // if (dt.Rows[n]["TrunkGroupID"] != null && dt.Rows[n]["TrunkGroupID"].ToString() != "")
  248. // {
  249. // model.TrunkGroupID = int.Parse(dt.Rows[n]["TrunkGroupID"].ToString());
  250. // }
  251. // }
  252. // if (dt.Rows[n]["CallerNum"] != null && dt.Rows[n]["CallerNum"].ToString() != "")
  253. // {
  254. // model.CallerNum = dt.Rows[n]["CallerNum"].ToString();
  255. // }
  256. // if (dt.Rows[n]["CallType"] != null && dt.Rows[n]["CallType"].ToString() != "")
  257. // {
  258. // model.CallType = int.Parse(dt.Rows[n]["CallType"].ToString());
  259. // }
  260. // if (dt.Rows[n]["ExInfo"] != null && dt.Rows[n]["ExInfo"].ToString() != "")
  261. // {
  262. // model.ExInfo = dt.Rows[n]["ExInfo"].ToString();
  263. // }
  264. // if (dt.Rows[n]["MaxTrunkCount"] != null && dt.Rows[n]["MaxTrunkCount"].ToString() != "")
  265. // {
  266. // model.MaxTrunkCount = int.Parse(dt.Rows[n]["MaxTrunkCount"].ToString());
  267. // }
  268. // if (dt.Rows[n]["IntensityCoefficient"] != null && dt.Rows[n]["IntensityCoefficient"].ToString() != "")
  269. // {
  270. // model.IntensityCoefficient = decimal.Parse(dt.Rows[n]["IntensityCoefficient"].ToString());
  271. // }
  272. // if (dt.Rows[n]["ItemTableName"] != null && dt.Rows[n]["ItemTableName"].ToString() != "")
  273. // {
  274. // model.ItemTableName = dt.Rows[n]["ItemTableName"].ToString();
  275. // }
  276. // if (dt.Rows[n]["State"] != null && dt.Rows[n]["State"].ToString() != "")
  277. // {
  278. // model.State = int.Parse(dt.Rows[n]["State"].ToString());
  279. // }
  280. // if (dt.Rows[n]["AddTime"] != null && dt.Rows[n]["AddTime"].ToString() != "")
  281. // {
  282. // model.AddTime = Convert.ToDateTime(dt.Rows[n]["AddTime"].ToString());
  283. // }
  284. // if (dt.Rows[n]["y_PSort"] != null && dt.Rows[n]["y_PSort"].ToString() != "")
  285. // {
  286. // model.y_PSort = int.Parse(dt.Rows[n]["y_PSort"].ToString());
  287. // }
  288. // if (dt.Rows[n]["y_TkModelId"] != null && dt.Rows[n]["y_TkModelId"].ToString() != "")
  289. // {
  290. // model.y_TkModelId = long.Parse(dt.Rows[n]["y_TkModelId"].ToString());
  291. // }
  292. // if (dt.Rows[n]["y_SXH"] != null && dt.Rows[n]["y_SXH"].ToString() != "")
  293. // {
  294. // model.y_SXH = int.Parse(dt.Rows[n]["y_SXH"].ToString());
  295. // }
  296. // if (dt.Rows[n]["y_FPCount"] != null && dt.Rows[n]["y_FPCount"].ToString() != "")
  297. // {
  298. // model.y_FPCount = int.Parse(dt.Rows[n]["y_FPCount"].ToString());
  299. // }
  300. // if (dt.Rows[n]["y_YJCount"] != null && dt.Rows[n]["y_YJCount"].ToString() != "")
  301. // {
  302. // model.y_YJCount = int.Parse(dt.Rows[n]["y_YJCount"].ToString());
  303. // }
  304. // if (dt.Rows[n]["y_HCCount"] != null && dt.Rows[n]["y_HCCount"].ToString() != "")
  305. // {
  306. // model.y_HCCount = int.Parse(dt.Rows[n]["y_HCCount"].ToString());
  307. // }
  308. // if (dt.Rows[n]["y_HSCount"] != null && dt.Rows[n]["y_HSCount"].ToString() != "")
  309. // {
  310. // model.y_HSCount = int.Parse(dt.Rows[n]["y_HSCount"].ToString());
  311. // }
  312. // if (dt.Rows[n]["y_HTCount"] != null && dt.Rows[n]["y_HTCount"].ToString() != "")
  313. // {
  314. // model.y_HTCount = int.Parse(dt.Rows[n]["y_HTCount"].ToString());
  315. // }
  316. // if (dt.Rows[n]["y_HMCount"] != null && dt.Rows[n]["y_HMCount"].ToString() != "")
  317. // {
  318. // model.y_HMCount = int.Parse(dt.Rows[n]["y_HMCount"].ToString());
  319. // }
  320. // if (dt.Rows[n]["y_OkCount"] != null && dt.Rows[n]["y_OkCount"].ToString() != "")
  321. // {
  322. // model.y_OkCount = int.Parse(dt.Rows[n]["y_OkCount"].ToString());
  323. // }
  324. // if (dt.Rows[n]["y_RFCount"] != null && dt.Rows[n]["y_RFCount"].ToString() != "")
  325. // {
  326. // model.y_RFCount = int.Parse(dt.Rows[n]["y_RFCount"].ToString());
  327. // }
  328. // if (dt.Rows[n]["y_ConsCount"] != null && dt.Rows[n]["y_ConsCount"].ToString() != "")
  329. // {
  330. // model.y_ConsCount = int.Parse(dt.Rows[n]["y_ConsCount"].ToString());
  331. // }
  332. // if (dt.Rows[n]["y_InvlCount"] != null && dt.Rows[n]["y_InvlCount"].ToString() != "")
  333. // {
  334. // model.y_InvlCount = int.Parse(dt.Rows[n]["y_InvlCount"].ToString());
  335. // }
  336. // if (dt.Rows[n]["y_NoAnswerCount"] != null && dt.Rows[n]["y_NoAnswerCount"].ToString() != "")
  337. // {
  338. // model.y_NoAnswerCount = int.Parse(dt.Rows[n]["y_NoAnswerCount"].ToString());
  339. // }
  340. // if (dt.Rows[n]["y_ShutDownCount"] != null && dt.Rows[n]["y_ShutDownCount"].ToString() != "")
  341. // {
  342. // model.y_ShutDownCount = int.Parse(dt.Rows[n]["y_ShutDownCount"].ToString());
  343. // }
  344. // if (dt.Rows[n]["TaskType"] != null && dt.Rows[n]["TaskType"].ToString() != "")
  345. // {
  346. // model.TaskType = int.Parse(dt.Rows[n]["TaskType"].ToString());
  347. // }
  348. // model.F_Title = dt.Rows[n]["F_Title"].ToString();
  349. // modelList.Add(model);
  350. // }
  351. // catch
  352. // {
  353. // throw new Exception("AddTime=" + dt.Rows[n]["AddTime"].ToString());
  354. // }
  355. // }
  356. // }
  357. // return modelList;
  358. //}
  359. /// <summary>
  360. /// 获得数据列表
  361. /// </summary>
  362. public DataSet GetAllList()
  363. {
  364. return GetList("");
  365. }
  366. /// <summary>
  367. /// 分页获取数据列表
  368. /// </summary>
  369. public int GetRecordCount(string strWhere)
  370. {
  371. return dal.GetRecordCount(strWhere);
  372. }
  373. /// <summary>
  374. /// 分页获取数据列表
  375. /// </summary>
  376. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  377. {
  378. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  379. }
  380. /// <summary>
  381. /// 分页获取数据列表
  382. /// </summary>
  383. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  384. //{
  385. //return dal.GetList(PageSize,PageIndex,strWhere);
  386. //}
  387. public DataSet GetTask(int groupId)
  388. {
  389. return dal.GetTask(groupId);
  390. }
  391. #endregion Method
  392. }
  393. }