Ejemplo n.º 1
0
        private List <string> GetAccessGroups()
        {
            var names        = new List <string>();
            var accessGroups = _accessGroupService.GetAllAccessGroups();

            foreach (var group in accessGroups)
            {
                names.Add(group.Name);
            }

            return(names);
        }
Ejemplo n.º 2
0
        public ViewResult Index()
        {
            var model = new AccessGroupIndexModel();

            try
            {
                model.AllAccessGroups = _accessGroupService.GetAllAccessGroups();
                return(View("Index", model));
            }
            catch (Exception)
            {
                model.AllAccessGroups = new List <AccessGroup>();
                ViewData["Message"]   = "Feil under henting av tilgangsgrupper.";
                return(View("Index", model));
            }
        }