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

            return(View());
        }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
        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));
        }