private void BtnOK_Click(object sender, EventArgs e) { try { if (Dialog_Basic.ModifyOrAdd == 0) { if (!ControllerManagement.ModifySubFamily(int.Parse(TextRefSubFamily.Text), TextBox.Text, Combobox.SelectedItem.ToString())) { MessageBox.Show("Fail to modify the subfamily ! "); } else { if (MessageBox.Show("Successfully modified the subfamily !") == DialogResult.OK) { Close(); } } } else if (Dialog_Basic.ModifyOrAdd == 1) { ControllerManagement.AddSubFamily(TextBox.Text, Combobox.SelectedItem.ToString()); if (MessageBox.Show("Successfully added the subfamily !") == DialogResult.OK) { Mercure.MainWindow.StatusSQL_Label.Text = "Operation on subFamily."; Close(); } } ControllerManagement.RefreshListViewSubFamily(); ControllerFurniture.RefreshListView(-1); } catch (Exception Exception) { MessageBox.Show("Error during the operation ! " + Exception.Message); } }