周口郸城医院 DanChengCallCenter_API

SF_Task.cs 4.6KB

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