using Lottomat.Application.Entity.BaseManage;
using Lottomat.Application.IService.BaseManage;
using Lottomat.Application.Service.BaseManage;
using Lottomat.Cache.Factory;
using Lottomat.Util.WebControl;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Lottomat.Application.Busines.BaseManage
{
///
/// 版 本
/// Copyright (c) 2016-2017
/// 创建人:赵轶
/// 日 期:2015.11.4 14:31
/// 描 述:角色管理
///
public class RoleBLL
{
private IRoleService service = new RoleService();
///
/// 缓存key
///
public string cacheKey = "RoleCache";
#region 获取数据
///
/// 角色列表
///
///
public IEnumerable GetList()
{
return service.GetList();
}
///
/// 角色列表
///
/// 分页
/// 查询参数
///
public IEnumerable GetPageList(Pagination pagination, string queryJson)
{
return service.GetPageList(pagination, queryJson);
}
///
/// 角色列表all
///
///
public List GetAllList()
{
return service.GetAllList().ToList();
}
///
/// 角色实体
///
/// 主键值
///
public RoleEntity 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, RoleEntity roleEntity)
{
try
{
service.SaveForm(keyValue, roleEntity);
CacheFactory.Cache().RemoveCache(cacheKey);
}
catch (Exception)
{
throw;
}
}
#endregion
}
}