NoticeBLL.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using LeaRun.Application.Entity.PublicInfoManage;
  2. using LeaRun.Application.IService.PublicInfoManage;
  3. using LeaRun.Application.Service.PublicInfoManage;
  4. using LeaRun.Util;
  5. using LeaRun.Util.WebControl;
  6. using System;
  7. using System.Collections.Generic;
  8. namespace LeaRun.Application.Busines.PublicInfoManage
  9. {
  10. /// <summary>
  11. /// 版 本 6.1
  12. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  13. /// 创建人:佘赐雄
  14. /// 日 期:2015.12.7 16:40
  15. /// 描 述:电子公告
  16. /// </summary>
  17. public class NoticeBLL
  18. {
  19. private INoticeService service = new NoticeService();
  20. #region 获取数据
  21. /// <summary>
  22. /// 公告列表
  23. /// </summary>
  24. /// <param name="pagination">分页</param>
  25. /// <param name="queryJson">查询参数</param>
  26. /// <returns></returns>
  27. public IEnumerable<NewsEntity> GetPageList(Pagination pagination, string queryJson)
  28. {
  29. return service.GetPageList(pagination, queryJson);
  30. }
  31. /// <summary>
  32. /// 公告实体
  33. /// </summary>
  34. /// <param name="keyValue">主键值</param>
  35. /// <returns></returns>
  36. public NewsEntity GetEntity(string keyValue)
  37. {
  38. NewsEntity newsEntity = service.GetEntity(keyValue);
  39. newsEntity.NewsContent = WebHelper.HtmlDecode(newsEntity.NewsContent);
  40. return newsEntity;
  41. }
  42. #endregion
  43. #region 提交数据
  44. /// <summary>
  45. /// 删除公告
  46. /// </summary>
  47. /// <param name="keyValue">主键</param>
  48. public void RemoveForm(string keyValue)
  49. {
  50. try
  51. {
  52. service.RemoveForm(keyValue);
  53. }
  54. catch (Exception)
  55. {
  56. throw;
  57. }
  58. }
  59. /// <summary>
  60. /// 保存公告表单(新增、修改)
  61. /// </summary>
  62. /// <param name="keyValue">主键值</param>
  63. /// <param name="newsEntity">公告实体</param>
  64. /// <returns></returns>
  65. public void SaveForm(string keyValue, NewsEntity newsEntity)
  66. {
  67. try
  68. {
  69. newsEntity.NewsContent = WebHelper.HtmlEncode(newsEntity.NewsContent);
  70. service.SaveForm(keyValue, newsEntity);
  71. }
  72. catch (Exception)
  73. {
  74. throw;
  75. }
  76. }
  77. #endregion
  78. }
  79. }