// Button 'Save' private void buttonNewHallConfirm_Click(object sender, EventArgs e) { Boolean hallexists = false; string hallname = textBoxHallname.Text; if (DBGetData.GetFloorplanHallExists(hallname) > 0) { hallexists = true; MessageBox.Show("Hall name already exists, select a different name."); } // Execute save if (!hallexists && !string.IsNullOrWhiteSpace(hallname) && comboBoxHallType.SelectedIndex > -1) { int halltypeid = Convert.ToInt32(comboBoxHallType.SelectedValue); DBSetData.FloorplanHallAdd(hallname, halltypeid); // Close form this.Close(); floorplanForm.LoadDataHall(); floorplanForm.Refresh(); new StatusMessage("Hall with name " + hallname + " is added to the database."); } }