You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

164 lines
4.5 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.TwoDevelopment.LogisticsManagement
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2019-05-05 15:44
  12. /// 描 述:宿舍卫生管理
  13. /// </summary>
  14. public class SanitationBLL : SanitationIBLL
  15. {
  16. private SanitationService sanitationService = new SanitationService();
  17. #region 获取数据
  18. /// <summary>
  19. /// 获取页面显示列表数据
  20. /// <summary>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public IEnumerable<Acc_SanitationEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return sanitationService.GetPageList(pagination, queryJson);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. /// <summary>
  42. /// 获取Acc_Sanitation表实体数据
  43. /// <param name="keyValue">主键</param>
  44. /// <summary>
  45. /// <returns></returns>
  46. public Acc_SanitationEntity GetAcc_SanitationEntity(string keyValue)
  47. {
  48. try
  49. {
  50. return sanitationService.GetAcc_SanitationEntity(keyValue);
  51. }
  52. catch (Exception ex)
  53. {
  54. if (ex is ExceptionEx)
  55. {
  56. throw;
  57. }
  58. else
  59. {
  60. throw ExceptionEx.ThrowBusinessException(ex);
  61. }
  62. }
  63. }
  64. /// <summary>
  65. /// 获取左侧树形数据
  66. /// <summary>
  67. /// <returns></returns>
  68. public List<TreeModel> GetTree()
  69. {
  70. try
  71. {
  72. List<Acc_DormitoryBuildEntity> list = sanitationService.GetSqlTree();
  73. List<TreeModel> treeList = new List<TreeModel>();
  74. foreach (Acc_DormitoryBuildEntity item in list)
  75. {
  76. TreeModel node = new TreeModel
  77. {
  78. id = item.ID.ToString(),
  79. text = item.Name.ToString(),
  80. value = item.ID.ToString(),
  81. showcheck = false,
  82. checkstate = 0,
  83. isexpand = false,
  84. parentId = item.ParentID == null ? "" : item.ParentID
  85. };
  86. treeList.Add(node);
  87. }
  88. return treeList.ToTree();
  89. }
  90. catch (Exception ex)
  91. {
  92. if (ex is ExceptionEx)
  93. {
  94. throw;
  95. }
  96. else
  97. {
  98. throw ExceptionEx.ThrowBusinessException(ex);
  99. }
  100. }
  101. }
  102. #endregion
  103. #region 提交数据
  104. /// <summary>
  105. /// 删除实体数据
  106. /// <param name="keyValue">主键</param>
  107. /// <summary>
  108. /// <returns></returns>
  109. public void DeleteEntity(string keyValue)
  110. {
  111. try
  112. {
  113. sanitationService.DeleteEntity(keyValue);
  114. }
  115. catch (Exception ex)
  116. {
  117. if (ex is ExceptionEx)
  118. {
  119. throw;
  120. }
  121. else
  122. {
  123. throw ExceptionEx.ThrowBusinessException(ex);
  124. }
  125. }
  126. }
  127. /// <summary>
  128. /// 保存实体数据(新增、修改)
  129. /// <param name="keyValue">主键</param>
  130. /// <summary>
  131. /// <returns></returns>
  132. public void SaveEntity(string keyValue, Acc_SanitationEntity entity)
  133. {
  134. try
  135. {
  136. sanitationService.SaveEntity(keyValue, entity);
  137. }
  138. catch (Exception ex)
  139. {
  140. if (ex is ExceptionEx)
  141. {
  142. throw;
  143. }
  144. else
  145. {
  146. throw ExceptionEx.ThrowBusinessException(ex);
  147. }
  148. }
  149. }
  150. #endregion
  151. }
  152. }