private void BtnOK_Click(object sender, EventArgs e) { try { if (Dialog_Basic.ModifyOrAdd == 0) { if (!ControllerManagement.ModifyFamily(int.Parse(TextRefFamily.Text), TextBox.Text)) { MessageBox.Show("Fail to modify the family ! "); } else { if (MessageBox.Show("Successfully modified the family !") == DialogResult.OK) { Close(); } } } else if (Dialog_Basic.ModifyOrAdd == 1) { ControllerManagement.AddFamily(TextBox.Text); if (MessageBox.Show("Successfully added the family !") == DialogResult.OK) { Close(); } } ControllerManagement.RefreshListViewFamily(); ControllerFurniture.RefreshListView(-1); } catch (Exception Exception) { MessageBox.Show("Error during the operation ! " + Exception.Message); } }