private void OnSaveClick(object sender, EventArgs e) { try { if (chkSqlAuth.Checked) { ServerCollection.Add(new ServerInfo { Name = txtServerName.Text, Credential = new Credential { Username = txtUsername.Text, Password = txtPassword.Text } }); } else { ServerCollection.Add(txtServerName.Text); } _serverBindingSource.DataSource = ServerCollection.GetAll(); lblConnectionString.Visible = true; AddServerPanel.SendToBack(); MessageBox.Show(string.Format("Server: {0} added successfully.", txtServerName.Text), Resources.DataSavedCaption, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, Resources.ErrorOccured); } }
private void OnCancelClick(object sender, EventArgs e) { lblConnectionString.Visible = true; AddServerPanel.SendToBack(); }