WeChatUserService.cs 2.1 KB

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