private void cmdOK_Click(object sender, System.EventArgs e)
{
this.SaveSettings();
if (tabControlChooseDatabase.SelectedTab == this.tabPageConnection)
{
string connectString = SqlServers.BuildConnectionString(optConnectionIntegratedSecurity.Checked, cboConnectionDatabaseName.Text, cboConnectionServerName.Text, txtConnectionUserName.Text, txtConnectionPassword.Text);
bool valid = SqlServers.TestConnectionString(connectString);
if (valid)
{
this.Action = ActionTypeConstants.Upgrade;
this.DialogResult = DialogResult.OK;
this.Close();
}
else
{
MessageBox.Show("The information does not describe a valid connection string.");
}
}
else if (tabControlChooseDatabase.SelectedTab == this.tabPageCreation)
{
bool error = false;
if (_cbCreateDatabase.Checked)
{
error = CreateDatabase();
}
if (!error)
{
string outputConnectString = SqlServers.BuildConnectionString(optCreationIntegratedSecurity.Checked, txtCreationDatabaseName.Text, cboCreationServerName.Text, txtCreationUserName.Text, txtCreationPassword.Text);
if (SqlServers.TestConnectionString(outputConnectString))
{
//_connectionString = outputConnectString;
//_databaseName = cboCreationServerName.Text + "." + txtCreationDatabaseName.Text;
//_createdDb = true;
}
this.Action = ActionTypeConstants.Create;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
else if (tabControlChooseDatabase.SelectedTab == this.tabPageAzureCopy)
{
this.Action = ActionTypeConstants.AzureCopy;
this.DialogResult = DialogResult.OK;
this.Close();
}
}