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; } } /// /// get all data /// public DataSet GetAllRaData() { return _raObj.Query(); } /// /// get all data /// public DataSet GetAllActiveData() { return _raObj.QueryActived(); } /* private void leavetypeDsConstruct() { return; } */ /// /// /// /// role authority /// role employee public void Initialize(int raId,int reId) { _raObj = raId != 0 ? new RoleAuthority(raId) : new RoleAuthority(); _reObj=reId!= 0 ? new RoleEmp(reId) : new RoleEmp(); ; } /// /// get a record by id 0 /// 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]; } /// /// 根据权限取所有有用该权限的角色 /// /// /// public DataTable GetRoleListByAuth(int author) { return _raObj.GetRoleListByAuth(author); } /// /// 取角色的人员列表 /// /// /// public DataTable GetEmListByRole(int role) { return _raObj.GetEmListByRole(role); } /// /// 取有某权限的人员列表 /// /// /// public DataTable GetEmListByAuth(int auth) { return _raObj.GetEmListByAuth(auth); } /// /// 取某人的角色列表 /// /// /// public DataTable GetRoleByEm(int emid) { return _raObj.GetRoleByEm(emid); } /// /// 取某人的权限列表 /// /// /// public DataTable GetAuthByEm(int emid,int warehouse=-1) { return _raObj.GetAuthByEm(emid,warehouse); } /// /// 取角色的权限列表 /// /// /// public DataTable GetAuthByRole(int roleId) { return _raObj.GetAuthByRole(roleId); } public DataTable GetAllActivedAuthority() { return new Authority().QueryActived().Tables[0]; } /// ///公共权限连接列表 /// /// public ArrayList GetPublicAuthorityList() { return _raObj.GetPublicAuthorityList(); } /// /// 公共权限表 /// /// public DataTable GetPublicAuthorityTable() { return _raObj.GetPublicAuthority(); } /// /// 用户的权限列表,包括公共权限 /// /// /// 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); } } }