Пример #1
0
        public IActionResult General()
        {
            var settings = _settingsService.GetAllSettings();
            var roles    = _userRolesService.GetAllUserRoles();

            var model = new SettingsViewModel()
            {
                SiteName              = settings.First(s => s.Name == SettingsConstants.SiteName).Value,
                SiteDescription       = settings.First(s => s.Name == SettingsConstants.SiteDescription).Value,
                IsRegistrationEnabled = Convert.ToBoolean(settings.First(s => s.Name == SettingsConstants.SiteRegistrationEnabled).Value),
                IsCommentsEnabled     = Convert.ToBoolean(settings.First(s => s.Name == SettingsConstants.SiteCommmentsEnabled).Value),
                FacebookUrl           = settings.First(s => s.Name == SettingsConstants.FacebookUrl).Value,
                TwitterUrl            = settings.First(s => s.Name == SettingsConstants.TwitterUrl).Value,
                InstagramUrl          = settings.First(s => s.Name == SettingsConstants.InstagramUrl).Value,
                YoutubeUrl            = settings.First(s => s.Name == SettingsConstants.YoutubeUrl).Value,
                DefaultUserRoleId     = int.Parse(settings.First(s => s.Name == SettingsConstants.DefaultUserRole).Value),
                UserRolesList         = new SelectList(roles, "RoleId", "DisplayName")
            };

            return(View(model));
        }
Пример #2
0
        public IActionResult Roles()
        {
            var roles = _userRolesService.GetAllUserRoles();

            return(View("Roles", roles));
        }