Beispiel #1
0
        public ViewResult Index()
        {
            ViewData["roles"]    = _roleAdminService.GetAllRoles().ToList();
            ViewData["settings"] = _configurationProvider.GetSystemSettings <AuthRoleSettings>();

            return(View());
        }
Beispiel #2
0
        public bool IsInstalled()
        {
            // if connection strings are stored in new location, all is well
            var databaseSettings = _systemConfigurationProvider.GetSystemSettings <DatabaseSettings>();

            if (!string.IsNullOrWhiteSpace(databaseSettings.ConnectionString))
            {
                return(true);
            }
            ConnectionStringSettings connectionString;

            try
            {
                // otherwise check the connection string
                connectionString = ConfigurationManager.ConnectionStrings["mrcms"];
                if (connectionString == null)
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }

            databaseSettings.ConnectionString     = connectionString.ConnectionString;
            databaseSettings.DatabaseProviderType = GetProviderType(connectionString.ProviderName);
            _systemConfigurationProvider.SaveSettings(databaseSettings);
            return(true);
        }
Beispiel #3
0
        public void SaveConnectionSettings(ICreateDatabase provider, InstallModel installModel)
        {
            DatabaseSettings databaseSettings = _systemConfigurationProvider.GetSystemSettings <DatabaseSettings>();

            databaseSettings.ConnectionString     = provider.GetConnectionString(installModel);
            databaseSettings.DatabaseProviderType = installModel.DatabaseProvider;

            _systemConfigurationProvider.SaveSettings(databaseSettings);
        }
        public ViewResult Mail()
        {
            var mailSettings = _configurationProvider.GetSystemSettings <MailSettings>();

            return(View(mailSettings));
        }
 protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, System.Type modelType)
 {
     return(_configurationProvider.GetSystemSettings <ThirdPartyAuthSettings>());
 }
 public ThirdPartyAuthSettings GetSettings()
 {
     return(_configurationProvider.GetSystemSettings <ThirdPartyAuthSettings>());
 }
        public bool IsInstalled()
        {
            var databaseSettings = _systemConfigurationProvider.GetSystemSettings <DatabaseSettings>();

            return(!string.IsNullOrWhiteSpace(databaseSettings.ConnectionString));
        }