郑州颐和随访系统

T_Cus_CustomerBase.cs 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. /// T_Cus_CustomerBase
  11. /// </summary>
  12. public partial class T_Cus_CustomerBase
  13. {
  14. private readonly CallCenterApi.DAL.T_Cus_CustomerBase dal = new CallCenterApi.DAL.T_Cus_CustomerBase();
  15. public T_Cus_CustomerBase()
  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 F_CustomerId)
  29. {
  30. return dal.Exists(F_CustomerId);
  31. }
  32. /// <summary>
  33. /// 增加一条数据
  34. /// </summary>
  35. public int Add(CallCenterApi.Model.T_Cus_CustomerBase model)
  36. {
  37. return dal.Add(model);
  38. }
  39. /// <summary>
  40. /// 更新一条数据
  41. /// </summary>
  42. public bool Update(CallCenterApi.Model.T_Cus_CustomerBase model)
  43. {
  44. return dal.Update(model);
  45. }
  46. /// <summary>
  47. /// 删除一条数据
  48. /// </summary>
  49. public bool Delete(int F_CustomerId)
  50. {
  51. return dal.Delete(F_CustomerId);
  52. }
  53. /// <summary>
  54. /// 删除一条数据
  55. /// </summary>
  56. public bool DeleteList(string F_CustomerIdlist)
  57. {
  58. return dal.DeleteList(F_CustomerIdlist);
  59. }
  60. /// <summary>
  61. /// 得到一个对象实体
  62. /// </summary>
  63. public CallCenterApi.Model.T_Cus_CustomerBase GetModel(int F_CustomerId)
  64. {
  65. return dal.GetModel(F_CustomerId);
  66. }
  67. /// <summary>
  68. /// 根据Openid 获取用户
  69. /// </summary>
  70. /// <param name="F_Mobile"></param>
  71. /// <returns></returns>
  72. public CallCenterApi.Model.T_Cus_CustomerBase GetModelByOpenid(string openid)
  73. {
  74. return dal.GetModelByOpenid(openid);
  75. }
  76. /// <summary>
  77. /// 通过电话号码获取客户信息
  78. /// </summary>
  79. /// <param name="F_Mobile"></param>
  80. /// <returns></returns>
  81. public CallCenterApi.Model.T_Cus_CustomerBase GetModel(string F_Mobile)
  82. {
  83. return dal.GetModel(F_Mobile);
  84. }
  85. /// <summary>
  86. /// 获得数据列表
  87. /// </summary>
  88. public DataSet GetList(string strWhere)
  89. {
  90. return dal.GetList(strWhere);
  91. }
  92. /// <summary>
  93. /// 获得前几行数据
  94. /// </summary>
  95. public DataSet GetList(int Top, string strWhere, string filedOrder)
  96. {
  97. return dal.GetList(Top, strWhere, filedOrder);
  98. }
  99. /// <summary>
  100. /// 获得数据列表
  101. /// </summary>
  102. public List<CallCenterApi.Model.T_Cus_CustomerBase> GetModelList(string strWhere)
  103. {
  104. DataSet ds = dal.GetList(strWhere);
  105. return DataTableToList(ds.Tables[0]);
  106. }
  107. /// <summary>
  108. /// 获得数据列表
  109. /// </summary>
  110. public List<CallCenterApi.Model.T_Cus_CustomerBase> DataTableToList(DataTable dt)
  111. {
  112. List<CallCenterApi.Model.T_Cus_CustomerBase> modelList = new List<CallCenterApi.Model.T_Cus_CustomerBase>();
  113. int rowsCount = dt.Rows.Count;
  114. if (rowsCount > 0)
  115. {
  116. CallCenterApi.Model.T_Cus_CustomerBase model;
  117. for (int n = 0; n < rowsCount; n++)
  118. {
  119. model = dal.DataRowToModel(dt.Rows[n]);
  120. if (model != null)
  121. {
  122. modelList.Add(model);
  123. }
  124. }
  125. }
  126. return modelList;
  127. }
  128. /// <summary>
  129. /// 获得数据列表
  130. /// </summary>
  131. public DataSet GetAllList()
  132. {
  133. return GetList("");
  134. }
  135. /// <summary>
  136. /// 分页获取数据列表
  137. /// </summary>
  138. public int GetRecordCount(string strWhere)
  139. {
  140. return dal.GetRecordCount(strWhere);
  141. }
  142. /// <summary>
  143. /// 分页获取数据列表
  144. /// </summary>
  145. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  146. {
  147. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  148. }
  149. /// <summary>
  150. /// 分页获取数据列表
  151. /// </summary>
  152. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  153. //{
  154. //return dal.GetList(PageSize,PageIndex,strWhere);
  155. //}
  156. /// <summary>
  157. /// 是否存在该记录
  158. /// </summary>
  159. public bool PhoneExists(string F_Mobile)
  160. {
  161. return dal.PhoneExists(F_Mobile);
  162. }
  163. /// <summary>
  164. /// 根据号码获取客户信息
  165. /// </summary>
  166. /// <param name="F_Mobile"></param>
  167. /// <returns></returns>
  168. public CallCenterApi.Model.T_Cus_CustomerBase GetModelByPhone(string F_Mobile)
  169. {
  170. return dal.GetModelByPhone(F_Mobile);
  171. }
  172. /// <summary>
  173. /// 删除一条数据
  174. /// </summary>
  175. public bool PhoneDelete(string F_Mobile)
  176. {
  177. return dal.PhoneDelete(F_Mobile);
  178. }
  179. /// <summary>
  180. /// 获取来电单位
  181. /// </summary>
  182. /// <returns>单位列表</returns>
  183. public List<string> GetLDdep()
  184. {
  185. return dal.GetLDdep();
  186. }
  187. /// <summary>
  188. /// 判断来电单位是否存在
  189. /// </summary>
  190. /// <returns></returns>
  191. public bool LDdepExist(string lddep)
  192. {
  193. return dal.LDdepExist(lddep);
  194. }
  195. /// <summary>
  196. /// 分页获取数据列表
  197. /// </summary>
  198. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  199. //{
  200. //return dal.GetList(PageSize,PageIndex,strWhere);
  201. //}
  202. #endregion BasicMethod
  203. #region ExtensionMethod
  204. #endregion ExtensionMethod
  205. }
  206. }