12345市长热线标准版-后端

T_Msg_Chat_Map.cs 4.5KB

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