市长热线演示版

T_Call_CallRecords.cs 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. 
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. using HySoft.Common;
  6. using HySoft.BaseCallCenter.Model;
  7. namespace HySoft.BaseCallCenter.BLL
  8. {
  9. /// <summary>
  10. /// 通话记录表
  11. /// </summary>
  12. public partial class T_Call_CallRecords
  13. {
  14. private readonly HySoft.BaseCallCenter.DAL.T_Call_CallRecords dal=new HySoft.BaseCallCenter.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(HySoft.BaseCallCenter.Model.T_Call_CallRecords model)
  36. {
  37. return dal.Add(model);
  38. }
  39. /// <summary>
  40. /// 更新一条数据
  41. /// </summary>
  42. public bool Update(HySoft.BaseCallCenter.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 HySoft.BaseCallCenter.Model.T_Call_CallRecords GetModel(int CallRecordsId)
  64. {
  65. return dal.GetModel(CallRecordsId);
  66. }
  67. /// <summary>
  68. /// 得到一个对象实体,从缓存中
  69. /// </summary>
  70. //public HySoft.BaseCallCenter.Model.T_Call_CallRecords GetModelByCache(int CallRecordsId)
  71. //{
  72. // string CacheKey = "T_Call_CallRecordsModel-" + CallRecordsId;
  73. // object objModel = HySoft.Common.DataCache.GetCache(CacheKey);
  74. // if (objModel == null)
  75. // {
  76. // try
  77. // {
  78. // objModel = dal.GetModel(CallRecordsId);
  79. // if (objModel != null)
  80. // {
  81. // int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
  82. // Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  83. // }
  84. // }
  85. // catch{}
  86. // }
  87. // return (HySoft.BaseCallCenter.Model.T_Call_CallRecords)objModel;
  88. //}
  89. /// <summary>
  90. /// 获得数据列表
  91. /// </summary>
  92. public DataSet GetList(string strWhere)
  93. {
  94. return dal.GetList(strWhere);
  95. }
  96. /// <summary>
  97. /// 获得前几行数据
  98. /// </summary>
  99. public DataSet GetList(int Top,string strWhere,string filedOrder)
  100. {
  101. return dal.GetList(Top,strWhere,filedOrder);
  102. }
  103. /// <summary>
  104. /// 获得数据列表
  105. /// </summary>
  106. public List<HySoft.BaseCallCenter.Model.T_Call_CallRecords> GetModelList(string strWhere)
  107. {
  108. DataSet ds = dal.GetList(strWhere);
  109. return DataTableToList(ds.Tables[0]);
  110. }
  111. /// <summary>
  112. /// 获得数据列表
  113. /// </summary>
  114. public List<HySoft.BaseCallCenter.Model.T_Call_CallRecords> DataTableToList(DataTable dt)
  115. {
  116. List<HySoft.BaseCallCenter.Model.T_Call_CallRecords> modelList = new List<HySoft.BaseCallCenter.Model.T_Call_CallRecords>();
  117. int rowsCount = dt.Rows.Count;
  118. if (rowsCount > 0)
  119. {
  120. HySoft.BaseCallCenter.Model.T_Call_CallRecords model;
  121. for (int n = 0; n < rowsCount; n++)
  122. {
  123. model = dal.DataRowToModel(dt.Rows[n]);
  124. if (model != null)
  125. {
  126. modelList.Add(model);
  127. }
  128. }
  129. }
  130. return modelList;
  131. }
  132. /// <summary>
  133. /// 获得数据列表
  134. /// </summary>
  135. public DataSet GetAllList()
  136. {
  137. return GetList("");
  138. }
  139. /// <summary>
  140. /// 分页获取数据列表
  141. /// </summary>
  142. public int GetRecordCount(string strWhere)
  143. {
  144. return dal.GetRecordCount(strWhere);
  145. }
  146. /// <summary>
  147. /// 分页获取数据列表
  148. /// </summary>
  149. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  150. {
  151. return dal.GetListByPage( strWhere, orderby, startIndex, endIndex);
  152. }
  153. /// <summary>
  154. /// 分页获取数据列表
  155. /// </summary>
  156. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  157. //{
  158. //return dal.GetList(PageSize,PageIndex,strWhere);
  159. //}
  160. #endregion BasicMethod
  161. #region ExtensionMethod
  162. #endregion ExtensionMethod
  163. #region 更新来电振铃电话记录信息
  164. /// <summary>
  165. /// 更新来电振铃电话记录信息
  166. /// </summary>
  167. public bool UpdateCallInRingTelRecord(Model.T_Call_CallRecords model)
  168. {
  169. return dal.UpdateCallInRingTelRecord(model);
  170. }
  171. #endregion
  172. #region 更新来电摘机电话记录信息
  173. /// <summary>
  174. /// 更新来电摘机电话记录信息
  175. /// </summary>
  176. public bool UpdateCallInAnswerTelRecord(Model.T_Call_CallRecords model)
  177. {
  178. return dal.UpdateCallInAnswerTelRecord(model);
  179. }
  180. #endregion
  181. #region 更新来电挂断电话记录信息
  182. /// <summary>
  183. /// 更新来电挂断电话记录信息
  184. /// </summary>
  185. public bool UpdateCallInHookTelRecord(string callId)
  186. {
  187. return dal.UpdateCallInHookTelRecord(callId);
  188. }
  189. #endregion
  190. #region 更新来电录音记录信息
  191. /// <summary>
  192. /// 更新来电录音记录信息
  193. /// </summary>
  194. public bool UpdateCallInPathTelRecord(Model.T_Call_CallRecords model)
  195. {
  196. return dal.UpdateCallInPathTelRecord(model);
  197. }
  198. #endregion
  199. #region 根据来电号码获取电话记录
  200. /// <summary>
  201. /// 根据来电号码获取电话记录
  202. /// </summary>
  203. public HySoft.BaseCallCenter.Model.T_Call_CallRecords GetModelByTelphone(string CallNumber)
  204. {
  205. return dal.GetModelByTelphone(CallNumber);
  206. }
  207. #endregion
  208. #region 根据CallId获取电话记录
  209. /// <summary>
  210. /// 根据CallId获取电话记录
  211. /// </summary>
  212. public HySoft.BaseCallCenter.Model.T_Call_CallRecords GetModelByCallId(string CallId)
  213. {
  214. return dal.GetModelByCallId(CallId);
  215. }
  216. /// <summary>
  217. /// 根据CallId获取电话记录
  218. /// </summary>
  219. public HySoft.BaseCallCenter.Model.T_Call_CallRecords GetModelByRecordId(string CallId)
  220. {
  221. return dal.GetModelByRecordId(CallId);
  222. }
  223. #endregion
  224. #region 更新来电处理状态信息
  225. /// <summary>
  226. /// 更新来电处理状态信息
  227. /// </summary>
  228. public bool UpdateCallInRecordDealType(string callid, int type)
  229. {
  230. return dal.UpdateCallInRecordDealType(callid, type);
  231. }
  232. #endregion
  233. }
  234. }