Пример #1
0
		private void Wizard_OnFinishClick(object sender, RoutedEventArgs e)
		{
			ConfigFileHelper configFile = new ConfigFileHelper();
			DatabaseUpdater databaseUpdateProvider = new DatabaseUpdater();

			DatabaseFileHelper.ResetDatabaseReadOnlyFlag();

			if (rdoSQLServer.IsChecked.HasValue && rdoSQLServer.IsChecked.Value)
				configFile.SaveConfigFile(model.CreateConnectionString(txtPassword.Password));
			else
			{
				if (databaseUpdateProvider.IsDatabaseVersionCorrect(GetConnectionString(true)))
					configFile.SaveConfigFileForSqlExpress2008(txtServerName.Text);
				else
					configFile.SaveConfigFileForSqlExpress2005(txtServerName.Text);
			}

			_isWizardFinished = true;
			_mainWindow.Visibility = Visibility.Visible;

			ConfigurationManager.RefreshSection("connectionStrings");
			Bootstrapper.Configure();

			databaseUpdateProvider.InitializeDatabase(GetConnectionString(false));

			_mainWindow.RefreshData();
			_mainWindow.SetRecentItems();

			Close();
		}
Пример #2
0
		private string GetConnectionString(bool isTest)
		{
			if (rdoSQLServer.IsChecked.HasValue && rdoSQLServer.IsChecked.Value)
				return model.CreateConnectionString(txtPassword.Password);
			else
				if (isTest)
					return model.CreateConnectionStringForSETest(txtServerName.Text);
				else
				{
					DatabaseUpdater databaseUpdateProvider = new DatabaseUpdater();

					if (databaseUpdateProvider.IsDatabaseVersionCorrect(model.CreateConnectionStringForSETest(txtServerName.Text)))
						return model.CreateConnectionStringForSE2008(txtServerName.Text);
					else
						return model.CreateConnectionStringForSE2005(txtServerName.Text);
				}
		}
Пример #3
0
		private void wizardPageDbValidation_PageShow(object sender, RoutedEventArgs e)
		{
			lstValidationIssues.Items.Add("Below are possible issues with your system:");
			lstValidationIssues.Items.Add("------------------------------------------------------------------------------------------------------");

			DatabaseUpdater databaseUpdateProvider = new DatabaseUpdater();

			bool isSql2008r2 = databaseUpdateProvider.IsDatabaseVersionCorrect(GetConnectionString(true));

			//if (rdoSQLServer.IsChecked.HasValue && rdoSQLServer.IsChecked.Value)
			//{
			//  if (isSql2008r2 == false)
			//  {
			//    lstValidationIssues.Items.Add(
			//      "You are not using SQL 2008, ensure that you have the DTC (Distributed Transaction Coordinator) enabled for network access. See the Scutex Documentation for more information.");
			//  }
			//}
			//else
			//{
			//  if (isSql2008r2 == false)
			//  {
			//    lstValidationIssues.Items.Add(
			//      "You are not using SQL Express 2008 R2, it's recommended that you have the latest version. See the Scutex Documentation for more information.");
			//  }
			//}

			if (lstValidationIssues.Items.Count == 2)
				lstValidationIssues.Items.Add("No issues detected.");

			pdgValidateDatabaseProgress.IsIndeterminate = false;
			lblDbValidateText.Content = "System validation complete, please review issues below.";
			wizardPageDbValidation.CanNext = true;
		}