using Learun.Cache.Base; using Learun.Cache.Factory; using Learun.Util; using System; using System.Collections.Generic; namespace Learun.Application.Organization { /// /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架 /// Copyright (c) 2013-2018 Hexagon PPM /// 创建人:研发部 /// 日 期:2017.03.04 /// 描 述:角色管理 /// public class RoleBLL : RoleIBLL { #region 属性 private RoleService roleService = new RoleService(); #endregion #region 获取数据 /// /// 获取角色数据列表 /// /// public List GetList(string ProjectId) { try { List list = list =roleService.GetList(ProjectId); return list; } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 获取角色数据列表 /// /// 关键字 /// public List GetList(string keyword, string ProjectId) { try { List list = GetList(ProjectId); if (!string.IsNullOrEmpty(keyword)) { list = list.FindAll(t => t.F_FullName.Contains(keyword) || t.F_EnCode.Contains(keyword)); } return list; } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 项目角色 /// /// 分页参数 /// 查询参数 /// public List GetPageList(Pagination pagination, string queryJson) { try { return roleService.GetPageList(pagination, queryJson); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 获取角色数据列表 /// /// 主键串 /// public IEnumerable GetListByRoleIds(string roleIds) { try { List list = GetList(""); list = list.FindAll(t => t.F_RoleId.Like(roleIds)); return list; } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 获取实体数据 /// /// 主键 /// public RoleEntity GetEntity(string keyValue) { try { return roleService.GetEntity(keyValue); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } #endregion #region 提交数据 /// /// 虚拟删除角色 /// /// 主键 public void VirtualDelete(string keyValue) { try { roleService.VirtualDelete(keyValue); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 保存角色(新增、修改) /// /// 主键值 /// 角色实体 /// public void SaveEntity(string keyValue, ref RoleEntity roleEntity) { try { roleService.SaveEntity(keyValue, ref roleEntity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } #endregion } }