using LeaRun.Application.Entity.BaseManage; using LeaRun.Application.IService.BaseManage; using LeaRun.Application.Service.BaseManage; using System; using System.Linq; using System.Collections.Generic; using LeaRun.Cache.Factory; namespace LeaRun.Application.Busines.BaseManage { /// /// 版 本 6.1 /// Copyright (c) 2013-2016 上海力软信息技术有限公司 /// 创建人:佘赐雄 /// 日 期:2015.11.02 14:27 /// 描 述:部门管理 /// public class DepartmentBLL { private IDepartmentService service = new DepartmentService(); /// /// 缓存key /// public string cacheKey = "DepartmentCache"; #region 获取数据 /// /// 部门列表 /// /// public IEnumerable GetList() { return service.GetList(); } /// /// 部门实体 /// /// 主键值 /// public DepartmentEntity GetEntity(string keyValue) { return service.GetEntity(keyValue); } #endregion #region 验证数据 /// /// 部门编号不能重复 /// /// 编号 /// 主键 /// public bool ExistEnCode(string enCode, string keyValue) { return service.ExistEnCode(enCode, keyValue); } /// /// 部门名称不能重复 /// /// 名称 /// 主键 /// public bool ExistFullName(string fullName, string keyValue) { return service.ExistFullName(fullName, keyValue); } #endregion #region 提交数据 /// /// 删除部门 /// /// 主键 public void RemoveForm(string keyValue) { try { service.RemoveForm(keyValue); CacheFactory.Cache().RemoveCache(cacheKey); } catch (Exception) { throw; } } /// /// 保存部门表单(新增、修改) /// /// 主键值 /// 部门实体 /// public void SaveForm(string keyValue, DepartmentEntity departmentEntity) { try { service.SaveForm(keyValue, departmentEntity); CacheFactory.Cache().RemoveCache(cacheKey); } catch (Exception) { throw; } } #endregion } }