暂无描述

T_Cus_AddressBook.cs 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. public partial class T_Cus_AddressBook
  10. {
  11. private readonly DAL.T_Cus_AddressBook dal = new DAL.T_Cus_AddressBook();
  12. public T_Cus_AddressBook()
  13. { }
  14. #region BasicMethod
  15. /// <summary>
  16. /// 得到最大ID
  17. /// </summary>
  18. public int GetMaxId()
  19. {
  20. return dal.GetMaxId();
  21. }
  22. /// <summary>
  23. /// 是否存在该记录
  24. /// </summary>
  25. public bool Exists(int F_UserId)
  26. {
  27. return dal.Exists(F_UserId);
  28. }
  29. /// <summary>
  30. /// 增加一条数据
  31. /// </summary>
  32. public int Add(Model.T_Cus_AddressBook model)
  33. {
  34. return dal.Add(model);
  35. }
  36. /// <summary>
  37. /// 更新一条数据
  38. /// </summary>
  39. public bool Update(Model.T_Cus_AddressBook model)
  40. {
  41. return dal.Update(model);
  42. }
  43. /// <summary>
  44. /// 删除一条数据
  45. /// </summary>
  46. public bool Delete(int F_UserId)
  47. {
  48. return dal.Delete(F_UserId);
  49. }
  50. /// <summary>
  51. /// 删除一条数据
  52. /// </summary>
  53. public bool DeleteList(string F_UserIdlist)
  54. {
  55. return dal.DeleteList(F_UserIdlist);
  56. }
  57. /// <summary>
  58. /// 得到一个对象实体
  59. /// </summary>
  60. public Model.T_Cus_AddressBook GetModel(int F_UserId)
  61. {
  62. return dal.GetModel(F_UserId);
  63. }
  64. ///// <summary>
  65. ///// 得到一个对象实体,从缓存中
  66. ///// </summary>
  67. //public Model.T_Cus_AddressBook GetModelByCache(int F_UserId)
  68. //{
  69. // string CacheKey = "T_Cus_AddressBookModel-" + F_UserId;
  70. // object objModel = Common.DataCache.GetCache(CacheKey);
  71. // if (objModel == null)
  72. // {
  73. // try
  74. // {
  75. // objModel = dal.GetModel(F_UserId);
  76. // if (objModel != null)
  77. // {
  78. // int ModelCache = Common.ConfigHelper.GetConfigInt("ModelCache");
  79. // Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  80. // }
  81. // }
  82. // catch { }
  83. // }
  84. // return (Model.T_Cus_AddressBook)objModel;
  85. //}
  86. /// <summary>
  87. /// 获得数据列表
  88. /// </summary>
  89. public DataSet GetList(string strWhere)
  90. {
  91. return dal.GetList(strWhere);
  92. }
  93. /// <summary>
  94. /// 获得前几行数据
  95. /// </summary>
  96. public DataSet GetList(int Top, string strWhere, string filedOrder)
  97. {
  98. return dal.GetList(Top, strWhere, filedOrder);
  99. }
  100. /// <summary>
  101. /// 获得数据列表
  102. /// </summary>
  103. public List<Model.T_Cus_AddressBook> GetModelList(string strWhere)
  104. {
  105. DataSet ds = dal.GetList(strWhere);
  106. return DataTableToList(ds.Tables[0]);
  107. }
  108. /// <summary>
  109. /// 获得数据列表
  110. /// </summary>
  111. public List<Model.T_Cus_AddressBook> DataTableToList(DataTable dt)
  112. {
  113. List<Model.T_Cus_AddressBook> modelList = new List<Model.T_Cus_AddressBook>();
  114. int rowsCount = dt.Rows.Count;
  115. if (rowsCount > 0)
  116. {
  117. Model.T_Cus_AddressBook model;
  118. for (int n = 0; n < rowsCount; n++)
  119. {
  120. model = dal.DataRowToModel(dt.Rows[n]);
  121. if (model != null)
  122. {
  123. modelList.Add(model);
  124. }
  125. }
  126. }
  127. return modelList;
  128. }
  129. /// <summary>
  130. /// 获得数据列表
  131. /// </summary>
  132. public DataSet GetAllList()
  133. {
  134. return GetList("");
  135. }
  136. /// <summary>
  137. /// 分页获取数据列表
  138. /// </summary>
  139. public int GetRecordCount(string strWhere)
  140. {
  141. return dal.GetRecordCount(strWhere);
  142. }
  143. /// <summary>
  144. /// 分页获取数据列表
  145. /// </summary>
  146. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  147. {
  148. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  149. }
  150. /// <summary>
  151. /// 分页获取数据列表
  152. /// </summary>
  153. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  154. //{
  155. //return dal.GetList(PageSize,PageIndex,strWhere);
  156. //}
  157. #endregion BasicMethod
  158. #region ExtensionMethod
  159. #endregion ExtensionMethod
  160. }
  161. }