public static List <Module> GetModulesByRole(int roleId, int branchId) { //return AUTDataManager.GetModulesByRole(roleId,branchId); List <Module> moduleList = AUTDataManager.GetModulesByRole(roleId, branchId); foreach (var module in moduleList) { List <Feature> featureList = AUTDataManager.GetFeatureByRoleModule(roleId, module.Id, branchId); module.Features = featureList; } return(moduleList); }
public static User GetUserByCredentials(string userName, string password) { User user = AUTDataManager.GetUserByCredentials(userName, password); if (user != null) { List <Module> moduleList = AUTDataManager.GetModulesByRole(user.RoleId, user.BranchId); foreach (var module in moduleList) { List <Feature> featureList = AUTDataManager.GetFeatureByRoleModule(user.RoleId, module.Id, user.BranchId); module.Features = featureList; } user.Modules = moduleList; } return(user); }