ScheduleService.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using LeaRun.Application.Entity.PublicInfoManage;
  2. using LeaRun.Application.IService.PublicInfoManage;
  3. using LeaRun.Data.Repository;
  4. using LeaRun.Util.WebControl;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. namespace LeaRun.Application.Service.PublicInfoManage
  8. {
  9. /// <summary>
  10. /// 版 本 6.1
  11. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  12. /// 创 建:佘赐雄
  13. /// 日 期:2016-04-25 10:45
  14. /// 描 述:日程管理
  15. /// </summary>
  16. public class ScheduleService : RepositoryFactory<ScheduleEntity>, IScheduleService
  17. {
  18. #region 获取数据
  19. /// <summary>
  20. /// 获取列表
  21. /// </summary>
  22. /// <param name="queryJson">查询参数</param>
  23. /// <returns>返回列表</returns>
  24. public IEnumerable<ScheduleEntity> GetList(string queryJson)
  25. {
  26. return this.BaseRepository().IQueryable().ToList();
  27. }
  28. /// <summary>
  29. /// 获取实体
  30. /// </summary>
  31. /// <param name="keyValue">主键值</param>
  32. /// <returns></returns>
  33. public ScheduleEntity GetEntity(string keyValue)
  34. {
  35. return this.BaseRepository().FindEntity(keyValue);
  36. }
  37. #endregion
  38. #region 提交数据
  39. /// <summary>
  40. /// 删除数据
  41. /// </summary>
  42. /// <param name="keyValue">主键</param>
  43. public void RemoveForm(string keyValue)
  44. {
  45. this.BaseRepository().Delete(keyValue);
  46. }
  47. /// <summary>
  48. /// 保存表单(新增、修改)
  49. /// </summary>
  50. /// <param name="keyValue">主键值</param>
  51. /// <param name="entity">实体对象</param>
  52. /// <returns></returns>
  53. public void SaveForm(string keyValue, ScheduleEntity entity)
  54. {
  55. if (!string.IsNullOrEmpty(keyValue))
  56. {
  57. entity.Modify(keyValue);
  58. this.BaseRepository().Update(entity);
  59. }
  60. else
  61. {
  62. entity.Create();
  63. this.BaseRepository().Insert(entity);
  64. }
  65. }
  66. #endregion
  67. }
  68. }