AdvertisementBLL.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Lottomat.Application.Entity.InformationManage;
  2. using Lottomat.Application.IService.InformationManage;
  3. using Lottomat.Application.Service.InformationManage;
  4. using Lottomat.Util.WebControl;
  5. using System.Collections.Generic;
  6. using System;
  7. using System.Linq.Expressions;
  8. namespace Lottomat.Application.Busines.InformationManage
  9. {
  10. /// <summary>
  11. /// 版 本 1.0
  12. /// Copyright (c) 2016-2017
  13. /// 创 建:超级管理员
  14. /// 日 期:2018-01-05 14:54
  15. /// 描 述:广告管理
  16. /// </summary>
  17. public class AdvertisementBLL
  18. {
  19. private IAdvertisementService service = new AdvertisementService();
  20. #region 获取数据
  21. /// <summary>
  22. /// 获取列表
  23. /// </summary>
  24. /// <param name="pagination">分页</param>
  25. /// <param name="queryJson">查询参数</param>
  26. /// <returns>返回分页列表</returns>
  27. public IEnumerable<AdvertisementEntity> GetPageList(Pagination pagination, string queryJson)
  28. {
  29. return service.GetPageList(pagination, queryJson);
  30. }
  31. /// <summary>
  32. /// 获取列表
  33. /// </summary>
  34. /// <param name="query">查询参数</param>
  35. /// <returns>返回列表</returns>
  36. public IEnumerable<AdvertisementEntity> GetList(Expression<Func<AdvertisementEntity, bool>> query)
  37. {
  38. return service.GetList(query);
  39. }
  40. /// <summary>
  41. /// 获取实体
  42. /// </summary>
  43. /// <param name="keyValue">主键值</param>
  44. /// <returns></returns>
  45. public AdvertisementEntity GetEntity(string keyValue)
  46. {
  47. return service.GetEntity(keyValue);
  48. }
  49. /// <summary>
  50. /// 获取实体
  51. /// </summary>
  52. /// <param name="query">条件</param>
  53. /// <returns></returns>
  54. public AdvertisementEntity GetEntity(Expression<Func<AdvertisementEntity, bool>> query)
  55. {
  56. return service.GetEntity(query);
  57. }
  58. #endregion
  59. #region 提交数据
  60. /// <summary>
  61. /// 删除数据
  62. /// </summary>
  63. /// <param name="keyValue">主键</param>
  64. public void RemoveForm(string keyValue)
  65. {
  66. try
  67. {
  68. service.RemoveForm(keyValue);
  69. }
  70. catch (Exception)
  71. {
  72. throw;
  73. }
  74. }
  75. /// <summary>
  76. /// 保存表单(新增、修改)
  77. /// </summary>
  78. /// <param name="keyValue">主键值</param>
  79. /// <param name="entity">实体对象</param>
  80. /// <returns></returns>
  81. public void SaveForm(string keyValue, AdvertisementEntity entity)
  82. {
  83. try
  84. {
  85. service.SaveForm(keyValue, entity);
  86. }
  87. catch (Exception e)
  88. {
  89. Console.WriteLine(e.Message);
  90. throw;
  91. }
  92. }
  93. #endregion
  94. }
  95. }