Нет описания

T_Que_Question_Map.cs 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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_Que_Question_Map
  13. {
  14. private readonly DAL.T_Que_Question_Map dal = new DAL.T_Que_Question_Map();
  15. public T_Que_Question_Map()
  16. { }
  17. #region BasicMethod
  18. /// <summary>
  19. /// 是否存在该记录
  20. /// </summary>
  21. public bool Exists(long Id)
  22. {
  23. return dal.Exists(Id);
  24. }
  25. /// <summary>
  26. /// 增加一条数据
  27. /// </summary>
  28. public long Add(Model.T_Que_Question_Map model)
  29. {
  30. return dal.Add(model);
  31. }
  32. /// <summary>
  33. /// 更新一条数据
  34. /// </summary>
  35. public bool Update(Model.T_Que_Question_Map model)
  36. {
  37. return dal.Update(model);
  38. }
  39. /// <summary>
  40. /// 删除一条数据
  41. /// </summary>
  42. public bool Delete(long Id)
  43. {
  44. return dal.Delete(Id);
  45. }
  46. /// <summary>
  47. /// 删除一条数据
  48. /// </summary>
  49. public bool Delete(string WorkOrderId)
  50. {
  51. return dal.Delete(WorkOrderId);
  52. }
  53. /// <summary>
  54. /// 删除一条数据
  55. /// </summary>
  56. public bool DeleteList(string Idlist)
  57. {
  58. return dal.DeleteList(Idlist);
  59. }
  60. /// <summary>
  61. /// 得到一个对象实体
  62. /// </summary>
  63. public Model.T_Que_Question_Map GetModel(long Id)
  64. {
  65. return dal.GetModel(Id);
  66. }
  67. ///// <summary>
  68. ///// 得到一个对象实体,从缓存中
  69. ///// </summary>
  70. //public Model.T_Que_Question_Map GetModelByCache(long Id)
  71. //{
  72. // string CacheKey = "T_Que_Question_MapModel-" + Id;
  73. // object objModel = Common.DataCache.GetCache(CacheKey);
  74. // if (objModel == null)
  75. // {
  76. // try
  77. // {
  78. // objModel = dal.GetModel(Id);
  79. // if (objModel != null)
  80. // {
  81. // int ModelCache = Common.ConfigHelper.GetConfigInt("ModelCache");
  82. // Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  83. // }
  84. // }
  85. // catch { }
  86. // }
  87. // return (Model.T_Que_Question_Map)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<Model.T_Que_Question_Map> 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<Model.T_Que_Question_Map> DataTableToList(DataTable dt)
  115. {
  116. List<Model.T_Que_Question_Map> modelList = new List<Model.T_Que_Question_Map>();
  117. int rowsCount = dt.Rows.Count;
  118. if (rowsCount > 0)
  119. {
  120. Model.T_Que_Question_Map 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. }
  164. }