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.

PMOrganizationBLL.cs 4.5 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.TwoDevelopment.PersonnelManagement
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2019-12-31 10:25
  12. /// 描 述:党组织管理架构表
  13. /// </summary>
  14. public class PMOrganizationBLL : PMOrganizationIBLL
  15. {
  16. private PMOrganizationService pMOrganizationService = new PMOrganizationService();
  17. #region 获取数据
  18. /// <summary>
  19. /// 获取页面显示列表数据
  20. /// <summary>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns></returns>
  23. public IEnumerable<PMOrganizationEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return pMOrganizationService.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. /// 获取PMOrganization表实体数据
  43. /// <param name="keyValue">主键</param>
  44. /// <summary>
  45. /// <returns></returns>
  46. public PMOrganizationEntity GetPMOrganizationEntity(string keyValue)
  47. {
  48. try
  49. {
  50. return pMOrganizationService.GetPMOrganizationEntity(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. DataTable list = pMOrganizationService.GetSqlTree();
  73. List<TreeModel> treeList = new List<TreeModel>();
  74. foreach (DataRow item in list.Rows)
  75. {
  76. TreeModel node = new TreeModel
  77. {
  78. id = item["id"].ToString(),
  79. text = item["id"].ToString(),
  80. value = item["id"].ToString(),
  81. showcheck = false,
  82. checkstate = 0,
  83. isexpand = true,
  84. parentId = item["parentid"].ToString()
  85. };
  86. treeList.Add(node); }
  87. return treeList.ToTree();
  88. }
  89. catch (Exception ex)
  90. {
  91. if (ex is ExceptionEx)
  92. {
  93. throw;
  94. }
  95. else
  96. {
  97. throw ExceptionEx.ThrowBusinessException(ex);
  98. }
  99. }
  100. }
  101. #endregion
  102. #region 提交数据
  103. /// <summary>
  104. /// 删除实体数据
  105. /// <param name="keyValue">主键</param>
  106. /// <summary>
  107. /// <returns></returns>
  108. public void DeleteEntity(string keyValue)
  109. {
  110. try
  111. {
  112. pMOrganizationService.DeleteEntity(keyValue);
  113. }
  114. catch (Exception ex)
  115. {
  116. if (ex is ExceptionEx)
  117. {
  118. throw;
  119. }
  120. else
  121. {
  122. throw ExceptionEx.ThrowBusinessException(ex);
  123. }
  124. }
  125. }
  126. /// <summary>
  127. /// 保存实体数据(新增、修改)
  128. /// <param name="keyValue">主键</param>
  129. /// <summary>
  130. /// <returns></returns>
  131. public void SaveEntity(string keyValue, PMOrganizationEntity entity)
  132. {
  133. try
  134. {
  135. pMOrganizationService.SaveEntity(keyValue, entity);
  136. }
  137. catch (Exception ex)
  138. {
  139. if (ex is ExceptionEx)
  140. {
  141. throw;
  142. }
  143. else
  144. {
  145. throw ExceptionEx.ThrowBusinessException(ex);
  146. }
  147. }
  148. }
  149. #endregion
  150. }
  151. }