暂无描述

T_Sys_Department.cs 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using CallCenter.Utility;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace CallCenterApi.BLL
  9. {
  10. /// <summary>
  11. /// T_Sys_Department
  12. /// </summary>
  13. public partial class T_Sys_Department
  14. {
  15. private readonly DAL.T_Sys_Department dal = new DAL.T_Sys_Department();
  16. public T_Sys_Department()
  17. { }
  18. #region BasicMethod
  19. /// <summary>
  20. /// 是否存在该记录
  21. /// </summary>
  22. public bool Exists(int F_DeptId)
  23. {
  24. return dal.Exists(F_DeptId);
  25. }
  26. /// <summary>
  27. /// 增加一条数据
  28. /// </summary>
  29. public int Add(Model.T_Sys_Department model)
  30. {
  31. OutRedis();
  32. return dal.Add(model);
  33. }
  34. /// <summary>
  35. /// 更新一条数据
  36. /// </summary>
  37. public bool Update(Model.T_Sys_Department model)
  38. {
  39. OutRedis();
  40. return dal.Update(model);
  41. }
  42. /// <summary>
  43. /// 删除一条数据
  44. /// </summary>
  45. public bool Delete(int F_DeptId)
  46. {
  47. OutRedis();
  48. return dal.Delete(F_DeptId);
  49. }
  50. /// <summary>
  51. /// 删除一条数据
  52. /// </summary>
  53. public bool DeleteList(string F_DeptIdlist)
  54. {
  55. OutRedis();
  56. return dal.DeleteList(F_DeptIdlist);
  57. }
  58. /// <summary>
  59. /// 得到一个对象实体
  60. /// </summary>
  61. public Model.T_Sys_Department GetModel(int F_DeptId)
  62. {
  63. return dal.GetModel(F_DeptId);
  64. }
  65. /// <summary>
  66. /// 得到一个对象实体
  67. /// </summary>
  68. public Model.T_Sys_Department GetModel(string F_DeptName)
  69. {
  70. return dal.GetModel(F_DeptName);
  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_Sys_Department> 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_Sys_Department> DataTableToList(DataTable dt)
  98. {
  99. List<Model.T_Sys_Department> modelList = new List<Model.T_Sys_Department>();
  100. int rowsCount = dt.Rows.Count;
  101. if (rowsCount > 0)
  102. {
  103. Model.T_Sys_Department 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. private void OutRedis()
  137. {
  138. RedisHelper.KeyDelete("ZTreeList_Shuanghui");
  139. }
  140. #endregion BasicMethod
  141. #region ExtensionMethod
  142. /// <summary>
  143. /// 更新部门编号
  144. /// </summary>
  145. public bool UpdateDeptCode(string deptcode, int deptid)
  146. {
  147. return dal.UpdateDeptCode(deptcode, deptid);
  148. }
  149. #endregion ExtensionMethod
  150. }
  151. }