Пример #1
0
 private void ButtonRemoveProfile_Click(object sender, EventArgs e)
 {
     if (comboBoxRemoveProfile.SelectedItem.ToString() != null)
     {
         string       messageToRemove = "Дійсно видалити профіль " + comboBoxRemoveProfile.SelectedItem.ToString() + " ?";
         string       caption         = "Видалення з бази данних!";
         DialogResult result          = MessageBox.Show(messageToRemove, caption,
                                                        MessageBoxButtons.YesNo,
                                                        MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             ProfileDTO removeProfile = new ProfileDTO();
             string     message       = removeProfile.RemoveProfile(comboBoxRemoveProfile.SelectedItem.ToString());
             MessageBox.Show(message);
             this.CleareAllComponent();
             this.FillAlComponent();
         }
         else
         {
             MessageBox.Show("Ви відмінили операцію видалення!");
         }
     }
     else
     {
         MessageBox.Show("Потрібно вибрати назву Профілю!");
     }
     this.CleareAllComponent();
     this.FillAlComponent();
 }