Пример #1
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (MessageBox.Show("Do you want to remove the selected DBConnection?", "Remove", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             for (int i = 0; i < _tmp_settings.DBConnections.Count; i++)
             {
                 if (_tmp_settings.DBConnections[i].DBConnectionName == DBConnectionNameTextBox.Text)
                 {
                     _tmp_settings.DBConnections.RemoveAt(i);
                     DBConnectionNameTextBox.Clear();
                     DBUserNameTextBox.Clear();
                     DBPasswordTextBox.Clear();
                     OracleTNSTextBox.Clear();
                     DBConnectionsComboBox.Items.RemoveAt(i);
                     DBConnectionsComboBox.Text = "";
                     RemoveDBConnButton.Enabled = false;
                     MessageBox.Show("DBConnection removed. Please, to apply this change permanently, click main Save button to close this Settings module", "Removed", MessageBoxButtons.OK);
                     break;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         CommonItem.ErrManger.ErrorManagement(ex, false, this);
     }
 }
Пример #2
0
 private void NewButton_Click(object sender, EventArgs e)
 {
     DBConnectionNameTextBox.Clear();
     DBUserNameTextBox.Clear();
     DBPasswordTextBox.Clear();
     OracleTNSTextBox.Clear();
     _newDbConnection = true;
 }