封丘民调

T_Video_CutScreen.cs 4.5KB

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