TrendChartService.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using Lottomat.Application.Entity.InformationManage;
  3. using Lottomat.Application.IService.InformationManage;
  4. using Lottomat.Data.Repository;
  5. using Lottomat.Util.WebControl;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Linq.Expressions;
  9. namespace Lottomat.Application.Service.InformationManage
  10. {
  11. /// <summary>
  12. /// 版 本 1.0
  13. /// Copyright (c) 2016-2017
  14. /// 创 建:超级管理员
  15. /// 日 期:2017-10-26 10:53
  16. /// 描 述:彩吧走势图
  17. /// </summary>
  18. public class TrendChartService : RepositoryFactory<TrendChartEntity>, ITrendChartService
  19. {
  20. private ITrendChartService _trendChartServiceImplementation;
  21. #region 获取数据
  22. /// <summary>
  23. /// 获取列表
  24. /// </summary>
  25. /// <param name="pagination">分页</param>
  26. /// <param name="queryJson">查询参数</param>
  27. /// <returns>返回分页列表</returns>
  28. public IEnumerable<TrendChartEntity> GetPageList(Pagination pagination, string queryJson)
  29. {
  30. return this.BaseRepository().FindList(pagination);
  31. }
  32. public IEnumerable<TrendChartEntity> GetList(Expression<Func<TrendChartEntity, bool>> condition)
  33. {
  34. return this.BaseRepository().FindList(condition);
  35. }
  36. /// <summary>
  37. /// 获取列表
  38. /// </summary>
  39. /// <param name="queryJson">查询参数</param>
  40. /// <returns>返回列表</returns>
  41. public IEnumerable<TrendChartEntity> GetList(string queryJson)
  42. {
  43. return this.BaseRepository().IQueryable().ToList();
  44. }
  45. /// <summary>
  46. /// 获取实体
  47. /// </summary>
  48. /// <param name="keyValue">主键值</param>
  49. /// <returns></returns>
  50. public TrendChartEntity GetEntity(string keyValue)
  51. {
  52. return this.BaseRepository().FindEntity(keyValue);
  53. }
  54. #endregion
  55. #region 提交数据
  56. /// <summary>
  57. /// 删除数据
  58. /// </summary>
  59. /// <param name="keyValue">主键</param>
  60. public void RemoveForm(string keyValue)
  61. {
  62. this.BaseRepository().Delete(keyValue);
  63. }
  64. /// <summary>
  65. /// 保存表单(新增、修改)
  66. /// </summary>
  67. /// <param name="keyValue">主键值</param>
  68. /// <param name="entity">实体对象</param>
  69. /// <returns></returns>
  70. public void SaveForm(string keyValue, TrendChartEntity entity)
  71. {
  72. if (!string.IsNullOrEmpty(keyValue))
  73. {
  74. entity.Modify(keyValue);
  75. this.BaseRepository().Update(entity);
  76. }
  77. else
  78. {
  79. entity.Create();
  80. this.BaseRepository().Insert(entity);
  81. }
  82. }
  83. #endregion
  84. }
  85. }