Esempio n. 1
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);
        }
Esempio n. 2
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 RedirectToRouteResult Index_Post([IoCModelBinder(typeof(SystemSettingsModelBinder))] List <SystemSettingsBase> settings)
 {
     settings.ForEach(s => _configurationProvider.SaveSettings(s));
     TempData["settings-saved"] = true;
     return(RedirectToAction("Index"));
 }
 public void SaveSettings(ThirdPartyAuthSettings thirdPartyAuthSettings)
 {
     _configurationProvider.SaveSettings(thirdPartyAuthSettings);
 }
Esempio n. 5
0
 public RedirectToRouteResult Index(AuthRoleSettings settings)
 {
     _configurationProvider.SaveSettings(settings);
     return(RedirectToAction("Index"));
 }