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