public virtual IActionResult Index()
        {
            if (DataSettingsManager.DatabaseIsInstalled)
            {
                return(RedirectToRoute("Homepage"));
            }

            var model = new InstallModel
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = string.Empty,
                DataProvider             = DataProviderType.SqlServer,
                //fast installation service does not support SQL compact
                DisableSampleDataOption = _config.DisableSampleDataDuringInstallation,
                SqlAuthenticationType   = "sqlauthentication",
                SqlConnectionInfo       = "sqlconnectioninfo_values",
                SqlServerCreateDatabase = false,
                UseCustomCollation      = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS"
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code
                });
            }

            return(View(model));
        }
        public virtual IActionResult Index()
        {
            if (DataSettingsManager.DatabaseIsInstalled)
            {
                return(RedirectToRoute("Homepage"));
            }

            var model = new InstallModel
            {
                AdminEmail        = "*****@*****.**",
                InstallSampleData = false,

                //fast installation service does not support SQL compact
                DisableSampleDataOption   = _config.DisableSampleDataDuringInstallation,
                CreateDatabaseIfNotExists = false,
                ConnectionStringRaw       = false,
                DataProvider           = DataProviderType.SqlServer,
                AvailableDataProviders = _locService.GetAvailableProviderTypes()?.ToList()
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code
                });
            }

            return(View(model));
        }
        public override IActionResult Index()
        {
            if (DataSettingsManager.DatabaseIsInstalled)
            {
                return(RedirectToRoute("HomePage"));
            }

            var model = new InstallModel
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = DataProviderType.MySQL,
                //fast installation service does not support SQL compact
                DisableSampleDataOption = _config.DisableSampleDataDuringInstallation,
                SqlAuthenticationType   = "mysqlauthentication",
                SqlConnectionInfo       = "mysqlconnectioninfo_values",
                SqlServerCreateDatabase = false,
                UseCustomCollation      = false,
                Collation = "utf8_unicode_ci",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            return(View("~/Plugins/Data.MySQL/Views/Index.cshtml", model));
        }
Beispiel #4
0
        public ActionResult Index()
        {
            if (DataSettingsHelper.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            //set page timeout to 5 minutes
            this.Server.ScriptTimeout = 300;

            var model = new InstallModel()
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "sqlserver",
                SqlAuthenticationType    = "sqlauthentication",
                SqlConnectionInfo        = "sqlconnectioninfo_values",
                SqlServerCreateDatabase  = false,
                UseCustomCollation       = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem()
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            return(View(model));
        }
Beispiel #5
0
        public ActionResult Index()
        {
            if (DataSettingsHelper.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            //set page timeout to 5 minutes
            this.Server.ScriptTimeout = 300;


            var model = new InstallModel
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "mongodb",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            return(View(model));
        }
        public virtual async Task <IActionResult> Index()
        {
            if (DataSettingsHelper.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            var installed = await _cacheManager.GetAsync <bool>("Installed");

            if (installed)
            {
                return(View(new InstallModel()
                {
                    Installed = true
                }));
            }

            var model = new InstallModel
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "mongodb",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }
            //prepare collation list
            foreach (var col in _locService.GetAvailableCollations())
            {
                model.AvailableCollation.Add(new SelectListItem
                {
                    Value    = col.Value,
                    Text     = col.Name,
                    Selected = _locService.GetCurrentLanguage().Code == col.Value,
                });
            }
            return(View(model));
        }
        public ActionResult Index()
        {
            if (DataSettings.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            //set page timeout to 5 minutes
            this.Server.ScriptTimeout = 300;

            var model = new InstallModel()
            {
                AdminEmail = _locService.GetResource("AdminEmailValue"),
                //AdminPassword = "******",
                //ConfirmPassword = "******",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "sqlce", // "sqlserver",
                SqlAuthenticationType    = "sqlauthentication",
                SqlConnectionInfo        = "sqlconnectioninfo_values",
                SqlServerCreateDatabase  = false,
                UseCustomCollation       = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem()
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            foreach (var lang in _locService.GetAvailableAppLanguages())
            {
                model.AvailableAppLanguages.Add(new SelectListItem()
                {
                    Value    = lang.Culture,
                    Text     = lang.Name,
                    Selected = lang.Culture == Thread.CurrentThread.CurrentCulture.IetfLanguageTag // TODO (?)
                });
            }

            model.AvailableMediaStorages.Add(new SelectListItem {
                Value = "db", Text = _locService.GetResource("MediaStorage.DB"), Selected = true
            });
            model.AvailableMediaStorages.Add(new SelectListItem {
                Value = "fs", Text = _locService.GetResource("MediaStorage.FS")
            });

            return(View(model));
        }
        public ActionResult Index()
        {
            if (DataSettingsHelper.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            //set page timeout to 5 minutes
            this.Server.ScriptTimeout = 300;


            var model = new InstallModel()
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "nuodb",
                //fast installation service does not support SQL compact
                DisableSqlCompact = !String.IsNullOrEmpty(ConfigurationManager.AppSettings["UseFastInstallationService"]) &&
                                    Convert.ToBoolean(ConfigurationManager.AppSettings["UseFastInstallationService"]),
                DisableSampleDataOption = !String.IsNullOrEmpty(ConfigurationManager.AppSettings["DisableSampleDataDuringInstallation"]) &&
                                          Convert.ToBoolean(ConfigurationManager.AppSettings["DisableSampleDataDuringInstallation"]),
                SqlAuthenticationType   = "sqlauthentication",
                SqlConnectionInfo       = "sqlconnectioninfo_values",
                SqlServerCreateDatabase = false,
                UseCustomCollation      = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS",
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem()
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            return(View(model));
        }
        private InstallModel PrepareLanguageList(InstallModel model)
        {
            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code
                });
            }

            return(model);
        }
Beispiel #10
0
        public virtual ActionResult Index()
        {
            if (DataSettingsHelper.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            //设置页面超时时间为5分钟
            this.Server.ScriptTimeout = 300;

            var model = new InstallModel
            {
                AdminEmail               = "*****@*****.**",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "sqlserver",
                //fast installation service does not support SQL compact
                DisableSampleDataOption = _config.DisableSampleDataDuringInstallation,
                SqlAuthenticationType   = "sqlauthentication",
                SqlConnectionInfo       = "sqlconnectioninfo_values",
                SqlServerCreateDatabase = false,
                UseCustomCollation      = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS"
            };

            foreach (var lang in _locService.GetAvailableLanguages())
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = _locService.GetCurrentLanguage().Code == lang.Code,
                });
            }

            return(View(model));
        }
Beispiel #11
0
        public ActionResult Index()
        {
            if (DataSettings.DatabaseIsInstalled())
            {
                return(RedirectToRoute("HomePage"));
            }

            // set page timeout to 10 minutes
            this.Server.ScriptTimeout = 600;

            var model = new InstallModel
            {
                AdminEmail = _locService.GetResource("AdminEmailValue"),
                //AdminPassword = "******",
                //ConfirmPassword = "******",
                InstallSampleData        = false,
                DatabaseConnectionString = "",
                DataProvider             = "sqlce", // "sqlserver",
                SqlAuthenticationType    = "sqlauthentication",
                SqlConnectionInfo        = "sqlconnectioninfo_values",
                SqlServerCreateDatabase  = false,
                UseCustomCollation       = false,
                Collation = "SQL_Latin1_General_CP1_CI_AS",
            };

            var curLanguage        = _locService.GetCurrentLanguage();
            var availableLanguages = _locService.GetAvailableLanguages();

            foreach (var lang in availableLanguages)
            {
                model.AvailableLanguages.Add(new SelectListItem
                {
                    Value    = Url.Action("ChangeLanguage", "Install", new { language = lang.Code }),
                    Text     = lang.Name,
                    Selected = curLanguage.Code == lang.Code,
                });
            }

            foreach (var lang in _locService.GetAvailableAppLanguages())
            {
                model.AvailableAppLanguages.Add(new SelectListItem
                {
                    Value    = lang.Culture,
                    Text     = lang.Name,
                    Selected = lang.UniqueSeoCode.IsCaseInsensitiveEqual(curLanguage.Code)
                });
            }

            if (!model.AvailableAppLanguages.Any(x => x.Selected))
            {
                model.AvailableAppLanguages.FirstOrDefault(x => x.Value.IsCaseInsensitiveEqual("en")).Selected = true;
            }

            model.AvailableMediaStorages.Add(new SelectListItem {
                Value = "db", Text = _locService.GetResource("MediaStorage.DB"), Selected = true
            });
            model.AvailableMediaStorages.Add(new SelectListItem {
                Value = "fs", Text = _locService.GetResource("MediaStorage.FS")
            });

            return(View(model));
        }