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.
 
 
 
 
 
 

176 lines
4.6 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 NewsBLL : NewsIBLL
  14. {
  15. private NewsService newsService = new NewsService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 新闻列表
  19. /// </summary>
  20. /// <param name="pagination">分页参数</param>
  21. /// <param name="categoryId">类型</param>
  22. /// <param name="keyword">关键词</param>
  23. /// <returns></returns>
  24. public IEnumerable<NewsEntity> GetPageList(Pagination pagination,string keyword)
  25. {
  26. try
  27. {
  28. return newsService.GetPageList(pagination, keyword);
  29. }
  30. catch (Exception ex)
  31. {
  32. if (ex is ExceptionEx)
  33. {
  34. throw;
  35. }
  36. else
  37. {
  38. throw ExceptionEx.ThrowBusinessException(ex);
  39. }
  40. }
  41. }
  42. public IEnumerable<NewsEntity> GetAboutSchool()
  43. {
  44. try
  45. {
  46. return newsService.GetAboutSchool();
  47. }
  48. catch (Exception ex)
  49. {
  50. if (ex is ExceptionEx)
  51. {
  52. throw;
  53. }
  54. else
  55. {
  56. throw ExceptionEx.ThrowBusinessException(ex);
  57. }
  58. }
  59. }
  60. public IEnumerable<NewsEntity> GetNews()
  61. {
  62. try
  63. {
  64. return newsService.GetNews();
  65. }
  66. catch (Exception ex)
  67. {
  68. if (ex is ExceptionEx)
  69. {
  70. throw;
  71. }
  72. else
  73. {
  74. throw ExceptionEx.ThrowBusinessException(ex);
  75. }
  76. }
  77. }
  78. /// <summary>
  79. /// 新闻公告实体
  80. /// </summary>
  81. /// <param name="keyValue">主键值</param>
  82. /// <returns></returns>
  83. public NewsEntity GetEntity(string keyValue)
  84. {
  85. try
  86. {
  87. return newsService.GetEntity(keyValue);
  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. /// </summary>
  106. /// <param name="keyValue">主键</param>
  107. public void DeleteEntity(string keyValue)
  108. {
  109. try
  110. {
  111. newsService.DeleteEntity(keyValue);
  112. }
  113. catch (Exception ex)
  114. {
  115. if (ex is ExceptionEx)
  116. {
  117. throw;
  118. }
  119. else
  120. {
  121. throw ExceptionEx.ThrowBusinessException(ex);
  122. }
  123. }
  124. }
  125. /// <summary>
  126. /// 保存(新增、修改)
  127. /// </summary>
  128. /// <param name="keyValue">主键值</param>
  129. /// <param name="newsEntity">新闻公告实体</param>
  130. /// <returns></returns>
  131. public void SaveEntity(string keyValue, NewsEntity newsEntity)
  132. {
  133. try
  134. {
  135. newsService.SaveEntity(keyValue, newsEntity);
  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. public void ChangeStatusByProcessId(string parameterProcessId, int p1)
  150. {
  151. try
  152. {
  153. newsService.ChangeStatusByProcessId(parameterProcessId, p1);
  154. }
  155. catch (Exception ex)
  156. {
  157. if (ex is ExceptionEx)
  158. {
  159. throw;
  160. }
  161. else
  162. {
  163. throw ExceptionEx.ThrowBusinessException(ex);
  164. }
  165. }
  166. }
  167. #endregion
  168. }
  169. }