鄂尔多斯-招源科技

T_Call_CallRecords.cs 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace CallCenterApi.BLL
  8. {
  9. /// <summary>
  10. /// 通话记录表
  11. /// </summary>
  12. public partial class T_Call_CallRecords
  13. {
  14. private readonly DAL.T_Call_CallRecords dal = new DAL.T_Call_CallRecords();
  15. public T_Call_CallRecords()
  16. { }
  17. #region BasicMethod
  18. /// <summary>
  19. /// 得到最大ID
  20. /// </summary>
  21. public int GetMaxId()
  22. {
  23. return dal.GetMaxId();
  24. }
  25. /// <summary>
  26. /// 是否存在该记录
  27. /// </summary>
  28. public bool Exists(int CallRecordsId)
  29. {
  30. return dal.Exists(CallRecordsId);
  31. }
  32. /// <summary>
  33. /// 增加一条数据
  34. /// </summary>
  35. public int Add(Model.T_Call_CallRecords model)
  36. {
  37. return dal.Add(model);
  38. }
  39. /// <summary>
  40. /// 更新一条数据
  41. /// </summary>
  42. public bool Update(Model.T_Call_CallRecords model)
  43. {
  44. return dal.Update(model);
  45. }
  46. /// <summary>
  47. /// 删除一条数据
  48. /// </summary>
  49. public bool Delete(int CallRecordsId)
  50. {
  51. return dal.Delete(CallRecordsId);
  52. }
  53. /// <summary>
  54. /// 删除一条数据
  55. /// </summary>
  56. public bool DeleteList(string CallRecordsIdlist)
  57. {
  58. return dal.DeleteList(CallRecordsIdlist);
  59. }
  60. /// <summary>
  61. /// 得到一个对象实体
  62. /// </summary>
  63. public Model.T_Call_CallRecords GetModel(int CallRecordsId)
  64. {
  65. return dal.GetModel(CallRecordsId);
  66. }
  67. /// <summary>
  68. /// 获得数据列表
  69. /// </summary>
  70. public DataSet GetList(string strWhere)
  71. {
  72. return dal.GetList(strWhere);
  73. }
  74. /// <summary>
  75. /// 获得前几行数据
  76. /// </summary>
  77. public DataSet GetList(int Top, string strWhere, string filedOrder)
  78. {
  79. return dal.GetList(Top, strWhere, filedOrder);
  80. }
  81. /// <summary>
  82. /// 获得数据列表
  83. /// </summary>
  84. public List<Model.T_Call_CallRecords> GetModelList(string strWhere)
  85. {
  86. DataSet ds = dal.GetList(strWhere);
  87. return DataTableToList(ds.Tables[0]);
  88. }
  89. /// <summary>
  90. /// 获得数据列表
  91. /// </summary>
  92. public List<Model.T_Call_CallRecords> DataTableToList(DataTable dt)
  93. {
  94. List<Model.T_Call_CallRecords> modelList = new List<Model.T_Call_CallRecords>();
  95. int rowsCount = dt.Rows.Count;
  96. if (rowsCount > 0)
  97. {
  98. Model.T_Call_CallRecords model;
  99. for (int n = 0; n < rowsCount; n++)
  100. {
  101. model = dal.DataRowToModel(dt.Rows[n]);
  102. if (model != null)
  103. {
  104. modelList.Add(model);
  105. }
  106. }
  107. }
  108. return modelList;
  109. }
  110. /// <summary>
  111. /// 获得数据列表
  112. /// </summary>
  113. public List<Model.T_Call_CallRecordsExpt> DataTableToListExpt(DataTable dt)
  114. {
  115. List<Model.T_Call_CallRecordsExpt> modelList = new List<Model.T_Call_CallRecordsExpt>();
  116. int rowsCount = dt.Rows.Count;
  117. if (rowsCount > 0)
  118. {
  119. Model.T_Call_CallRecordsExpt model;
  120. for (int n = 0; n < rowsCount; n++)
  121. {
  122. model = dal.DataRowToModelExpt(dt.Rows[n]);
  123. if (model != null)
  124. {
  125. modelList.Add(model);
  126. }
  127. }
  128. }
  129. return modelList;
  130. }
  131. /// <summary>
  132. /// 获得数据列表
  133. /// </summary>
  134. public DataSet GetAllList()
  135. {
  136. return GetList("");
  137. }
  138. /// <summary>
  139. /// 分页获取数据列表
  140. /// </summary>
  141. public int GetRecordCount(string strWhere)
  142. {
  143. return dal.GetRecordCount(strWhere);
  144. }
  145. /// <summary>
  146. /// 分页获取数据列表
  147. /// </summary>
  148. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  149. {
  150. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  151. }
  152. #endregion BasicMethod
  153. #region ExtensionMethod
  154. #endregion ExtensionMethod
  155. #region 更新来电振铃电话记录信息
  156. /// <summary>
  157. /// 更新来电振铃电话记录信息
  158. /// </summary>
  159. public bool UpdateCallInRingTelRecord(Model.T_Call_CallRecords model)
  160. {
  161. return dal.UpdateCallInRingTelRecord(model);
  162. }
  163. #endregion
  164. #region 更新来电摘机电话记录信息
  165. /// <summary>
  166. /// 更新来电摘机电话记录信息
  167. /// </summary>
  168. public bool UpdateCallInAnswerTelRecord(Model.T_Call_CallRecords model)
  169. {
  170. return dal.UpdateCallInAnswerTelRecord(model);
  171. }
  172. #endregion
  173. #region 更新来电挂断电话记录信息
  174. /// <summary>
  175. /// 更新来电挂断电话记录信息
  176. /// </summary>
  177. public bool UpdateCallInHookTelRecord(string callId)
  178. {
  179. return dal.UpdateCallInHookTelRecord(callId);
  180. }
  181. #endregion
  182. #region 更新来电录音记录信息
  183. /// <summary>
  184. /// 更新来电录音记录信息
  185. /// </summary>
  186. public bool UpdateCallInPathTelRecord(Model.T_Call_CallRecords model)
  187. {
  188. return dal.UpdateCallInPathTelRecord(model);
  189. }
  190. #endregion
  191. #region 根据来电号码获取电话记录
  192. /// <summary>
  193. /// 根据来电号码获取电话记录
  194. /// </summary>
  195. public Model.T_Call_CallRecords GetModelByTelphone(string CallNumber)
  196. {
  197. return dal.GetModelByTelphone(CallNumber);
  198. }
  199. #endregion
  200. #region 根据CallId获取电话记录
  201. /// <summary>
  202. /// 根据CallId获取电话记录
  203. /// </summary>
  204. public Model.T_Call_CallRecords GetModelByCallId(string CallId)
  205. {
  206. return dal.GetModelByCallId(CallId);
  207. }
  208. /// <summary>
  209. /// 根据CallId获取电话记录
  210. /// </summary>
  211. public Model.T_Call_CallRecords GetModelByRecordId(string CallId)
  212. {
  213. return dal.GetModelByRecordId(CallId);
  214. }
  215. #endregion
  216. #region 更新来电处理状态信息
  217. /// <summary>
  218. /// 更新来电处理状态信息
  219. /// </summary>
  220. public bool UpdateCallInRecordDealType(string callid, int type)
  221. {
  222. return dal.UpdateCallInRecordDealType(callid, type);
  223. }
  224. #endregion
  225. #region 导出通话记录
  226. /// <summary>
  227. /// 导出通话记录
  228. /// </summary>
  229. /// <param name="strWhere"></param>
  230. /// <returns></returns>
  231. public DataSet GetListExpt(string strWhere)
  232. {
  233. return dal.GetListExpt(strWhere);
  234. }
  235. #endregion
  236. }
  237. }