JobBLL.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. using LeaRun.Application.Entity.BaseManage;
  2. using LeaRun.Application.IService.BaseManage;
  3. using LeaRun.Application.Service.BaseManage;
  4. using LeaRun.Cache.Factory;
  5. using LeaRun.Util.WebControl;
  6. using System;
  7. using System.Collections.Generic;
  8. namespace LeaRun.Application.Busines.BaseManage
  9. {
  10. /// <summary>
  11. /// 版 本
  12. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  13. /// 创建人:佘赐雄
  14. /// 日 期:2015.11.4 14:31
  15. /// 描 述:职位管理
  16. /// </summary>
  17. public class JobBLL
  18. {
  19. private IJobService service = new JobService();
  20. /// <summary>
  21. /// 缓存key
  22. /// </summary>
  23. public string cacheKey = "JobCache";
  24. #region 获取数据
  25. /// <summary>
  26. /// 职位列表
  27. /// </summary>
  28. /// <returns></returns>
  29. public IEnumerable<RoleEntity> GetList()
  30. {
  31. return service.GetList();
  32. }
  33. /// <summary>
  34. /// 职位列表
  35. /// </summary>
  36. /// <param name="pagination">分页</param>
  37. /// <param name="queryJson">查询参数</param>
  38. /// <returns></returns>
  39. public IEnumerable<RoleEntity> GetPageList(Pagination pagination, string queryJson)
  40. {
  41. return service.GetPageList(pagination, queryJson);
  42. }
  43. /// <summary>
  44. /// 职位实体
  45. /// </summary>
  46. /// <param name="keyValue">主键值</param>
  47. /// <returns></returns>
  48. public RoleEntity GetEntity(string keyValue)
  49. {
  50. return service.GetEntity(keyValue);
  51. }
  52. #endregion
  53. #region 验证数据
  54. /// <summary>
  55. /// 职位编号不能重复
  56. /// </summary>
  57. /// <param name="enCode">编号</param>
  58. /// <param name="keyValue">主键</param>
  59. /// <returns></returns>
  60. public bool ExistEnCode(string enCode, string keyValue)
  61. {
  62. return service.ExistEnCode(enCode, keyValue);
  63. }
  64. /// <summary>
  65. /// 职位名称不能重复
  66. /// </summary>
  67. /// <param name="fullName">名称</param>
  68. /// <param name="keyValue">主键</param>
  69. /// <returns></returns>
  70. public bool ExistFullName(string fullName, string keyValue)
  71. {
  72. return service.ExistFullName(fullName, keyValue);
  73. }
  74. #endregion
  75. #region 提交数据
  76. /// <summary>
  77. /// 删除职位
  78. /// </summary>
  79. /// <param name="keyValue">主键</param>
  80. public void RemoveForm(string keyValue)
  81. {
  82. try
  83. {
  84. service.RemoveForm(keyValue);
  85. CacheFactory.Cache().RemoveCache(cacheKey);
  86. }
  87. catch (Exception)
  88. {
  89. throw;
  90. }
  91. }
  92. /// <summary>
  93. /// 保存职位表单(新增、修改)
  94. /// </summary>
  95. /// <param name="keyValue">主键值</param>
  96. /// <param name="jobEntity">职位实体</param>
  97. /// <returns></returns>
  98. public void SaveForm(string keyValue, RoleEntity jobEntity)
  99. {
  100. try
  101. {
  102. service.SaveForm(keyValue, jobEntity);
  103. CacheFactory.Cache().RemoveCache(cacheKey);
  104. }
  105. catch (Exception)
  106. {
  107. throw;
  108. }
  109. }
  110. #endregion
  111. }
  112. }