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 7.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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> GetPageLists(Pagination pagination, string keyword)
  42. {
  43. try
  44. {
  45. return noticeService.GetPageLists(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. public IEnumerable<NewsEntity> GetPageListRevert(Pagination pagination, string keyword)
  60. {
  61. try
  62. {
  63. return noticeService.GetPageListRevert(pagination, keyword);
  64. }
  65. catch (Exception ex)
  66. {
  67. if (ex is ExceptionEx)
  68. {
  69. throw;
  70. }
  71. else
  72. {
  73. throw ExceptionEx.ThrowBusinessException(ex);
  74. }
  75. }
  76. }
  77. /// <summary>
  78. /// 公告列表
  79. /// </summary>
  80. /// <param name="pagination">分页参数</param>
  81. /// <param name="keyword">关键词</param>
  82. /// <returns></returns>
  83. public IEnumerable<NewsEntity> GetListApp(Pagination pagination, string keyword)
  84. {
  85. try
  86. {
  87. return noticeService.GetListApp(pagination, keyword);
  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. /// <summary>
  102. /// 公告实体
  103. /// </summary>
  104. /// <param name="keyValue">主键值</param>
  105. /// <returns></returns>
  106. public NewsEntity GetEntity(string keyValue)
  107. {
  108. try
  109. {
  110. return noticeService.GetEntity(keyValue);
  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. #endregion
  125. #region 提交数据
  126. /// <summary>
  127. /// 删除
  128. /// </summary>
  129. /// <param name="keyValue">主键</param>
  130. public void DeleteEntity(string keyValue)
  131. {
  132. try
  133. {
  134. noticeService.DeleteEntity(keyValue);
  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. public void RecycleForm(string keyValue,string status)
  149. {
  150. try
  151. {
  152. noticeService.RecycleForm(keyValue,status);
  153. }
  154. catch (Exception ex)
  155. {
  156. if (ex is ExceptionEx)
  157. {
  158. throw;
  159. }
  160. else
  161. {
  162. throw ExceptionEx.ThrowBusinessException(ex);
  163. }
  164. }
  165. }
  166. /// <summary>
  167. /// 保存(新增、修改)
  168. /// </summary>
  169. /// <param name="keyValue">主键值</param>
  170. /// <param name="newsEntity">公告实体</param>
  171. /// <returns></returns>
  172. public void SaveEntity(string keyValue, NewsEntity newsEntity)
  173. {
  174. try
  175. {
  176. noticeService.SaveEntity(keyValue, newsEntity);
  177. }
  178. catch (Exception ex)
  179. {
  180. if (ex is ExceptionEx)
  181. {
  182. throw;
  183. }
  184. else
  185. {
  186. throw ExceptionEx.ThrowBusinessException(ex);
  187. }
  188. }
  189. }
  190. #endregion
  191. #region 扩展数据
  192. /// <summary>
  193. /// 公告列表
  194. /// </summary>
  195. /// <param name="keyword">关键词</param>
  196. /// <returns></returns>
  197. public IEnumerable<NewsEntity> GetList(string keyword, string categoryId = null)
  198. {
  199. try
  200. {
  201. return noticeService.GetList(keyword, categoryId);
  202. }
  203. catch (Exception ex)
  204. {
  205. if (ex is ExceptionEx)
  206. {
  207. throw;
  208. }
  209. else
  210. {
  211. throw ExceptionEx.ThrowBusinessException(ex);
  212. }
  213. }
  214. }
  215. /// <summary>
  216. /// 公告列表
  217. /// </summary>
  218. /// <param name="keyword">关键词</param>
  219. /// <returns></returns>
  220. public IEnumerable<NewsEntity> GetLists(string queryJson, string categoryId = null)
  221. {
  222. try
  223. {
  224. return noticeService.GetLists(queryJson, categoryId);
  225. }
  226. catch (Exception ex)
  227. {
  228. if (ex is ExceptionEx)
  229. {
  230. throw;
  231. }
  232. else
  233. {
  234. throw ExceptionEx.ThrowBusinessException(ex);
  235. }
  236. }
  237. }
  238. #endregion
  239. #region 流程
  240. public void ChangeStatusById(string keyValue, int status, string processId)
  241. {
  242. try
  243. {
  244. noticeService.ChangeStatusById(keyValue, status, processId);
  245. }
  246. catch (Exception ex)
  247. {
  248. if (ex is ExceptionEx)
  249. {
  250. throw;
  251. }
  252. else
  253. {
  254. throw ExceptionEx.ThrowBusinessException(ex);
  255. }
  256. }
  257. }
  258. public NewsEntity GetEntityByProcessId(string processId)
  259. {
  260. try
  261. {
  262. return noticeService.GetEntityByProcessId(processId);
  263. }
  264. catch (Exception ex)
  265. {
  266. if (ex is ExceptionEx)
  267. {
  268. throw;
  269. }
  270. else
  271. {
  272. throw ExceptionEx.ThrowBusinessException(ex);
  273. }
  274. }
  275. }
  276. #endregion
  277. }
  278. }