85 lines
2.7 KiB
C#
85 lines
2.7 KiB
C#
using HL_FristAidPlatform_DataBase;
|
|
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
|
|
namespace HL_FristAidPlatform_Bussiness
|
|
{
|
|
public class T_SYS_RoleBLL
|
|
{
|
|
private IT_SYS_Role IService = new T_SYS_RoleDB();
|
|
public MessageModel<T_SYS_Role> Add(T_SYS_Role role)
|
|
{
|
|
if (IService.Add(role))
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = true, Msg = "操作成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = false, Msg = "操作失败" };
|
|
}
|
|
}
|
|
|
|
public MessageModel<T_SYS_Role> Dels(dynamic[] ids)
|
|
{
|
|
if (IService.Dels(ids))
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = true, Msg = "操作成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = false, Msg = "操作失败" };
|
|
}
|
|
}
|
|
|
|
public T_SYS_Role Get(long id)
|
|
{
|
|
return IService.Get(id);
|
|
}
|
|
|
|
public MessageModel<T_SYS_Role> Update(T_SYS_Role role)
|
|
{
|
|
if (IService.Update(role))
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = true, Msg = "操作成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = false, Msg = "操作失败" };
|
|
}
|
|
}
|
|
public TableModel<T_SYS_Role> GetList(string keyWord, int deleteFlag)
|
|
{
|
|
return IService.GetList(keyWord, deleteFlag);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 逻辑删除
|
|
/// </summary>
|
|
/// <param name="id">GUID</param>
|
|
/// <param name="deleteFlag">标记:0取消删除 1删除</param>
|
|
/// <returns></returns>
|
|
public MessageModel<T_SYS_Role> LogicalDelete(long id, int deleteFlag)
|
|
{
|
|
if (IService.LogicalDelete(id, deleteFlag) > 0)
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = true, Msg = "操作成功" };
|
|
}
|
|
else
|
|
{
|
|
return new MessageModel<T_SYS_Role> { Success = false, Msg = "操作失败" };
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 获取用户未拥有的角色列表
|
|
/// </summary>
|
|
/// <param name="userID">用户编号</param>
|
|
/// <param name="keyWord">关键词</param>
|
|
/// <returns></returns>
|
|
public TableModel<T_SYS_Role> GetUserNotHaveRoleList(long userID, string keyWord)
|
|
{
|
|
return IService.GetUserNotHaveRoleList(userID, keyWord);
|
|
}
|
|
}
|
|
}
|