// GET: SystemRoles public ActionResult Index() { ViewData["RolesPage"] = "active"; ViewData["PageTopTitle"] = "System Roles"; var modules = moduleService.GetAllModules(); var roles = rolesService.GetSystemRoles(); Dictionary <SystemRole, Dictionary <SystemModule, List <RolesModulesMapping> > > mappings = new Dictionary <SystemRole, Dictionary <SystemModule, List <RolesModulesMapping> > >(); foreach (var role in roles) { Dictionary <SystemModule, List <RolesModulesMapping> > mod = new Dictionary <SystemModule, List <RolesModulesMapping> >(); foreach (var module in modules) { IEnumerable <RolesModulesMapping> mappingsList = rolesService .GetViewsModulesMappingByModuleIdAndRoleId(module.ModuleId, role.RoleId); if (mappingsList != null) { if (mappingsList.Any()) { mod.Add(module, mappingsList.ToList()); } } } mappings.Add(role, mod); } return(View(mappings)); }
public IHttpActionResult GetRoleModulesMappingsList(int roleId) { try { var modules = moduleService.GetAllModules(); List <RolesModulesMappingAPI> mappings = new List <RolesModulesMappingAPI>(); foreach (var module in modules) { var res = rolesService.GetViewsModulesMappingByModuleIdAndRoleId(module.ModuleId, roleId).ToList(); if (res.Any()) { mappings.Add(new RolesModulesMappingAPI() { RoleId = roleId, ModuleId = module.ModuleId, ModuleName = module.ModuleName, Mappings = res } ); } } return(Ok(mappings)); } catch (Exception ex) { return(InternalServerError(ex)); } }
// GET: Home public ActionResult Index() { ViewData["dashboardPage"] = "active"; ViewData["PageTopTitle"] = "Dashboard"; var modules = _service.GetAllModules(); return(View(modules)); }
// GET: SystemModules public ActionResult Index() { ViewData["modulesPage"] = "active"; ViewData["PageTopTitle"] = "System Modules"; var modules = _modulesService.GetAllModules(); return(View(modules)); }
public IHttpActionResult GetModules(int pageNumber) { try { var modules = modulesService.GetAllModules() .Select(m => new SystemModule() { IsActive = m.IsActive, ModuleId = m.ModuleId, CreatedDate = m.CreatedDate, ModuleName = m.ModuleName }); return(Ok(modules)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IHttpActionResult GetSystemModules() { try { return(Ok(modulesService.GetAllModules())); } catch (Exception ex) { return(InternalServerError(ex)); } }