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.

NoticeBLL.cs 4.9 KiB

4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.OA
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2017.04.17
  11. /// 描 述:公告管理
  12. /// </summary>
  13. public class NoticeBLL : NoticeIBLL
  14. {
  15. private NoticeService noticeService = new NoticeService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 公告列表
  19. /// </summary>
  20. /// <param name="pagination">分页参数</param>
  21. /// <param name="keyword">关键词</param>
  22. /// <returns></returns>
  23. public IEnumerable<NewsEntity> GetPageList(Pagination pagination, string keyword)
  24. {
  25. try
  26. {
  27. return noticeService.GetPageList(pagination, keyword);
  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. /// 公告实体
  43. /// </summary>
  44. /// <param name="keyValue">主键值</param>
  45. /// <returns></returns>
  46. public NewsEntity GetEntity(string keyValue)
  47. {
  48. try
  49. {
  50. return noticeService.GetEntity(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. #endregion
  65. #region 提交数据
  66. /// <summary>
  67. /// 删除
  68. /// </summary>
  69. /// <param name="keyValue">主键</param>
  70. public void DeleteEntity(string keyValue)
  71. {
  72. try
  73. {
  74. noticeService.DeleteEntity(keyValue);
  75. }
  76. catch (Exception ex)
  77. {
  78. if (ex is ExceptionEx)
  79. {
  80. throw;
  81. }
  82. else
  83. {
  84. throw ExceptionEx.ThrowBusinessException(ex);
  85. }
  86. }
  87. }
  88. /// <summary>
  89. /// 保存(新增、修改)
  90. /// </summary>
  91. /// <param name="keyValue">主键值</param>
  92. /// <param name="newsEntity">公告实体</param>
  93. /// <returns></returns>
  94. public void SaveEntity(string keyValue, NewsEntity newsEntity)
  95. {
  96. try
  97. {
  98. noticeService.SaveEntity(keyValue, newsEntity);
  99. }
  100. catch (Exception ex)
  101. {
  102. if (ex is ExceptionEx)
  103. {
  104. throw;
  105. }
  106. else
  107. {
  108. throw ExceptionEx.ThrowBusinessException(ex);
  109. }
  110. }
  111. }
  112. #endregion
  113. #region 扩展数据
  114. /// <summary>
  115. /// 公告列表
  116. /// </summary>
  117. /// <param name="keyword">关键词</param>
  118. /// <returns></returns>
  119. public IEnumerable<NewsEntity> GetList(string keyword, string userId, string categoryId = null)
  120. {
  121. try
  122. {
  123. return noticeService.GetList(keyword, userId, categoryId);
  124. }
  125. catch (Exception ex)
  126. {
  127. if (ex is ExceptionEx)
  128. {
  129. throw;
  130. }
  131. else
  132. {
  133. throw ExceptionEx.ThrowBusinessException(ex);
  134. }
  135. }
  136. }
  137. #endregion
  138. #region 流程
  139. public void ChangeStatusById(string keyValue, int status, string processId)
  140. {
  141. try
  142. {
  143. noticeService.ChangeStatusById(keyValue, status, processId);
  144. }
  145. catch (Exception ex)
  146. {
  147. if (ex is ExceptionEx)
  148. {
  149. throw;
  150. }
  151. else
  152. {
  153. throw ExceptionEx.ThrowBusinessException(ex);
  154. }
  155. }
  156. }
  157. public NewsEntity GetEntityByProcessId(string processId)
  158. {
  159. try
  160. {
  161. return noticeService.GetEntityByProcessId(processId);
  162. }
  163. catch (Exception ex)
  164. {
  165. if (ex is ExceptionEx)
  166. {
  167. throw;
  168. }
  169. else
  170. {
  171. throw ExceptionEx.ThrowBusinessException(ex);
  172. }
  173. }
  174. }
  175. #endregion
  176. }
  177. }