人民医院API

T_QC_IndexBase.cs 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 RMYY_CallCenter_Api.Bll
  8. {
  9. public class T_QC_IndexBase
  10. {
  11. private readonly Dal.T_QC_IndexBase dal = new Dal.T_QC_IndexBase();
  12. public T_QC_IndexBase()
  13. { }
  14. #region BasicMethod
  15. /// <summary>
  16. /// 是否存在该记录
  17. /// </summary>
  18. public bool Exists(int F_IndexId)
  19. {
  20. return dal.Exists(F_IndexId);
  21. }
  22. /// <summary>
  23. /// 增加一条数据
  24. /// </summary>
  25. public int Add(Model.T_QC_IndexBase model)
  26. {
  27. return dal.Add(model);
  28. }
  29. /// <summary>
  30. /// 更新一条数据
  31. /// </summary>
  32. public bool Update(Model.T_QC_IndexBase model)
  33. {
  34. return dal.Update(model);
  35. }
  36. /// <summary>
  37. /// 删除一条数据
  38. /// </summary>
  39. public bool Delete(int F_IndexId)
  40. {
  41. return dal.Delete(F_IndexId);
  42. }
  43. /// <summary>
  44. /// 删除一条数据
  45. /// </summary>
  46. public bool DeleteList(string F_IndexIdlist)
  47. {
  48. return dal.DeleteList(F_IndexIdlist);
  49. }
  50. /// <summary>
  51. /// 得到一个对象实体
  52. /// </summary>
  53. public Model.T_QC_IndexBase GetModel(int F_IndexId)
  54. {
  55. return dal.GetModel(F_IndexId);
  56. }
  57. /// <summary>
  58. /// 获得数据列表
  59. /// </summary>
  60. public DataSet GetList(string strWhere)
  61. {
  62. return dal.GetList(strWhere);
  63. }
  64. /// <summary>
  65. /// 获得前几行数据
  66. /// </summary>
  67. public DataSet GetList(int Top, string strWhere, string filedOrder)
  68. {
  69. return dal.GetList(Top, strWhere, filedOrder);
  70. }
  71. /// <summary>
  72. /// 获得数据列表
  73. /// </summary>
  74. public List<Model.T_QC_IndexBase> GetModelList(string strWhere)
  75. {
  76. DataSet ds = dal.GetList(strWhere);
  77. return DataTableToList(ds.Tables[0]);
  78. }
  79. /// <summary>
  80. /// 获得数据列表
  81. /// </summary>
  82. public List<Model.T_QC_IndexBase> DataTableToList(DataTable dt)
  83. {
  84. List<Model.T_QC_IndexBase> modelList = new List<Model.T_QC_IndexBase>();
  85. int rowsCount = dt.Rows.Count;
  86. if (rowsCount > 0)
  87. {
  88. Model.T_QC_IndexBase model;
  89. for (int n = 0; n < rowsCount; n++)
  90. {
  91. model = dal.DataRowToModel(dt.Rows[n]);
  92. if (model != null)
  93. {
  94. modelList.Add(model);
  95. }
  96. }
  97. }
  98. return modelList;
  99. }
  100. /// <summary>
  101. /// 获得数据列表
  102. /// </summary>
  103. public DataSet GetAllList()
  104. {
  105. return GetList("");
  106. }
  107. /// <summary>
  108. /// 分页获取数据列表
  109. /// </summary>
  110. public int GetRecordCount(string strWhere)
  111. {
  112. return dal.GetRecordCount(strWhere);
  113. }
  114. /// <summary>
  115. /// 分页获取数据列表
  116. /// </summary>
  117. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  118. {
  119. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  120. }
  121. #endregion BasicMethod
  122. }
  123. }