public ActionResult Index() { var databaseStatusGenerator = new SetupStatusGenerator(_schemaRepository, _pathMapper); var databaseStatus = databaseStatusGenerator.GetSetupStatus(); if (databaseStatus.StatusCode == SetupStatusCode.DatabaseError) { return RedirectToRoute("SetupError"); } if (databaseStatus.StatusCode == SetupStatusCode.HasUpdates) { return RedirectToRoute("UpdateDatabase"); } if (databaseStatus.StatusCode == SetupStatusCode.NoUpdates && !_settingsRepository.InstallationComplete) { return RedirectToRoute("SetupIndex"); } if (databaseStatus.StatusCode == SetupStatusCode.NoUpdates && _settingsRepository.InstallationComplete) { return RedirectToAction("Index", "Home", new { Area = "" }); } var databaseSetupModel = new DatabaseSetupModel { Scripts = _pathMapper.GetAvailableScripts().ToList().Select(s => Path.GetFileName(s.ScriptPath)).ToList() }; return View(databaseSetupModel); }
private SetupStatus GetDatabaseUpdateStatus() { var databaseStatusGenerator = new SetupStatusGenerator(_schemaRepository, _pathMapper); var databaseStatus = databaseStatusGenerator.GetSetupStatus(); return databaseStatus; }
private bool GetDatabaseUpdateStatus() { var databaseStatusGenerator = new SetupStatusGenerator(_schemaRepository, _pathMapper); var databaseStatus = databaseStatusGenerator.GetSetupStatus(); return GetUserId() == 1 && databaseStatus.StatusCode == SetupStatusCode.HasUpdates; }
private void VerifyInstallation() { var schemaInstance = InstanceFactory.CreateSchemaInstance(); var pathMapper = InstanceFactory.CreatePathMapperInstance(); var dbStatusGenerator = new SetupStatusGenerator(schemaInstance, pathMapper); Application["Installation_Status"] = dbStatusGenerator.GetSetupStatus(); }