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.
 
 
 
 
 
 

227 lines
5.9 KiB

  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. public IEnumerable<NewsEntity> GetPageListRevert(Pagination pagination, string keyword)
  42. {
  43. try
  44. {
  45. return noticeService.GetPageListRevert(pagination, keyword);
  46. }
  47. catch (Exception ex)
  48. {
  49. if (ex is ExceptionEx)
  50. {
  51. throw;
  52. }
  53. else
  54. {
  55. throw ExceptionEx.ThrowBusinessException(ex);
  56. }
  57. }
  58. }
  59. /// <summary>
  60. /// 公告实体
  61. /// </summary>
  62. /// <param name="keyValue">主键值</param>
  63. /// <returns></returns>
  64. public NewsEntity GetEntity(string keyValue)
  65. {
  66. try
  67. {
  68. return noticeService.GetEntity(keyValue);
  69. }
  70. catch (Exception ex)
  71. {
  72. if (ex is ExceptionEx)
  73. {
  74. throw;
  75. }
  76. else
  77. {
  78. throw ExceptionEx.ThrowBusinessException(ex);
  79. }
  80. }
  81. }
  82. #endregion
  83. #region 提交数据
  84. /// <summary>
  85. /// 删除
  86. /// </summary>
  87. /// <param name="keyValue">主键</param>
  88. public void DeleteEntity(string keyValue)
  89. {
  90. try
  91. {
  92. noticeService.DeleteEntity(keyValue);
  93. }
  94. catch (Exception ex)
  95. {
  96. if (ex is ExceptionEx)
  97. {
  98. throw;
  99. }
  100. else
  101. {
  102. throw ExceptionEx.ThrowBusinessException(ex);
  103. }
  104. }
  105. }
  106. public void RecycleForm(string keyValue,string status)
  107. {
  108. try
  109. {
  110. noticeService.RecycleForm(keyValue,status);
  111. }
  112. catch (Exception ex)
  113. {
  114. if (ex is ExceptionEx)
  115. {
  116. throw;
  117. }
  118. else
  119. {
  120. throw ExceptionEx.ThrowBusinessException(ex);
  121. }
  122. }
  123. }
  124. /// <summary>
  125. /// 保存(新增、修改)
  126. /// </summary>
  127. /// <param name="keyValue">主键值</param>
  128. /// <param name="newsEntity">公告实体</param>
  129. /// <returns></returns>
  130. public void SaveEntity(string keyValue, NewsEntity newsEntity)
  131. {
  132. try
  133. {
  134. noticeService.SaveEntity(keyValue, newsEntity);
  135. }
  136. catch (Exception ex)
  137. {
  138. if (ex is ExceptionEx)
  139. {
  140. throw;
  141. }
  142. else
  143. {
  144. throw ExceptionEx.ThrowBusinessException(ex);
  145. }
  146. }
  147. }
  148. #endregion
  149. #region 扩展数据
  150. /// <summary>
  151. /// 公告列表
  152. /// </summary>
  153. /// <param name="keyword">关键词</param>
  154. /// <returns></returns>
  155. public IEnumerable<NewsEntity> GetList(string keyword, string userId, string categoryId = null)
  156. {
  157. try
  158. {
  159. return noticeService.GetList(keyword, userId, categoryId);
  160. }
  161. catch (Exception ex)
  162. {
  163. if (ex is ExceptionEx)
  164. {
  165. throw;
  166. }
  167. else
  168. {
  169. throw ExceptionEx.ThrowBusinessException(ex);
  170. }
  171. }
  172. }
  173. #endregion
  174. #region 流程
  175. public void ChangeStatusById(string keyValue, int status, string processId)
  176. {
  177. try
  178. {
  179. noticeService.ChangeStatusById(keyValue, status, processId);
  180. }
  181. catch (Exception ex)
  182. {
  183. if (ex is ExceptionEx)
  184. {
  185. throw;
  186. }
  187. else
  188. {
  189. throw ExceptionEx.ThrowBusinessException(ex);
  190. }
  191. }
  192. }
  193. public NewsEntity GetEntityByProcessId(string processId)
  194. {
  195. try
  196. {
  197. return noticeService.GetEntityByProcessId(processId);
  198. }
  199. catch (Exception ex)
  200. {
  201. if (ex is ExceptionEx)
  202. {
  203. throw;
  204. }
  205. else
  206. {
  207. throw ExceptionEx.ThrowBusinessException(ex);
  208. }
  209. }
  210. }
  211. #endregion
  212. }
  213. }