193 lines
4.6 KiB
C#
193 lines
4.6 KiB
C#
using System;
|
|
using System.Collections;
|
|
using DeiNiu.wms.Data.Model;
|
|
using System.Data;
|
|
namespace DeiNiu.wms.Logical
|
|
{
|
|
[Serializable]
|
|
public class LRoleAuthority
|
|
{
|
|
RoleAuthority _raObj;
|
|
RoleEmp _reObj;
|
|
|
|
public LRoleAuthority()
|
|
{
|
|
|
|
Initialize();
|
|
}
|
|
|
|
public RoleAuthority GetRoleAuthority
|
|
{
|
|
get
|
|
{
|
|
return _raObj;
|
|
}
|
|
}
|
|
public RoleEmp GetRoleEmp
|
|
{
|
|
get
|
|
{
|
|
return _reObj;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// get all data
|
|
/// </summary>
|
|
public DataSet GetAllRaData()
|
|
{
|
|
return _raObj.Query();
|
|
}
|
|
|
|
/// <summary>
|
|
/// get all data
|
|
/// </summary>
|
|
public DataSet GetAllActiveData()
|
|
{
|
|
return _raObj.QueryActived();
|
|
}
|
|
|
|
|
|
/*
|
|
private void leavetypeDsConstruct()
|
|
{
|
|
return;
|
|
}
|
|
*/
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="raId"> role authority</param>
|
|
/// <param name="reId">role employee</param>
|
|
public void Initialize(int raId,int reId)
|
|
{
|
|
_raObj = raId != 0 ? new RoleAuthority(raId) : new RoleAuthority();
|
|
_reObj=reId!= 0 ? new RoleEmp(reId) : new RoleEmp(); ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// get a record by id 0
|
|
/// </summary>
|
|
public void Initialize()
|
|
{
|
|
Initialize(0,0);
|
|
}
|
|
|
|
public DataTable GetAllDepartments()
|
|
{
|
|
return new Department().QueryActived().Tables[0];
|
|
}
|
|
public DataTable GetAllEmployee()
|
|
{
|
|
return new Employee().QueryActived().Tables[0];
|
|
}
|
|
public DataTable GetAllRoles()
|
|
{
|
|
return new Role().QueryActived().Tables[0];
|
|
}
|
|
/// <summary>
|
|
/// 根据权限取所有有用该权限的角色
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetRoleListByAuth(int author)
|
|
{
|
|
return _raObj.GetRoleListByAuth(author);
|
|
}
|
|
/// <summary>
|
|
/// 取角色的人员列表
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetEmListByRole(int role)
|
|
{
|
|
|
|
return _raObj.GetEmListByRole(role);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 取有某权限的人员列表
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetEmListByAuth(int auth)
|
|
{
|
|
|
|
return _raObj.GetEmListByAuth(auth);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 取某人的角色列表
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetRoleByEm(int emid)
|
|
{
|
|
|
|
return _raObj.GetRoleByEm(emid);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 取某人的权限列表
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetAuthByEm(int emid,int warehouse=-1)
|
|
{
|
|
|
|
return _raObj.GetAuthByEm(emid,warehouse);
|
|
}
|
|
/// <summary>
|
|
/// 取角色的权限列表
|
|
/// </summary>
|
|
/// <param name="author"></param>
|
|
/// <returns></returns>
|
|
public DataTable GetAuthByRole(int roleId)
|
|
{
|
|
|
|
return _raObj.GetAuthByRole(roleId);
|
|
}
|
|
|
|
public DataTable GetAllActivedAuthority()
|
|
{
|
|
return new Authority().QueryActived().Tables[0];
|
|
}
|
|
/// <summary>
|
|
///公共权限连接列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetPublicAuthorityList()
|
|
{
|
|
return _raObj.GetPublicAuthorityList();
|
|
}
|
|
/// <summary>
|
|
/// 公共权限表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public DataTable GetPublicAuthorityTable()
|
|
{
|
|
return _raObj.GetPublicAuthority();
|
|
}
|
|
/// <summary>
|
|
/// 用户的权限列表,包括公共权限
|
|
/// </summary>
|
|
/// <param name="emId"></param>
|
|
/// <returns></returns>
|
|
public ArrayList GetAuthorityList(int emId)
|
|
{
|
|
return _raObj.GetAuthorityList(emId);
|
|
}
|
|
|
|
public DataTable QueryNonePublicAuthority()
|
|
{
|
|
return new Authority().QueryNonePublicAuthority();
|
|
}
|
|
public ArrayList GetApproveRoleList(int empId)
|
|
{
|
|
return _raObj.GetApproveRoleList(empId);
|
|
}
|
|
}
|
|
|
|
|
|
}
|