private void btnUpdateVenue_Click(object sender, EventArgs e) { //Validate data entered if (!txtVenueName.Text.Equals("") && !txtStreet.Text.Equals("") && !txtTown.Text.Equals("") && !txtEmail.Text.Equals("") && !txtCapacity.Text.Equals("") && !txtContactNo.Text.Equals("") && !txtPassword.Text.Equals("")) { Venue myVenue = new Venue(); myVenue.setName(txtVenueName.Text); myVenue.setVenueDetails(); myVenue.setStreet(txtStreet.Text); myVenue.setTown(txtTown.Text); myVenue.setCapacity(Convert.ToInt32(txtCapacity.Text)); myVenue.setContactNo(txtContactNo.Text); myVenue.setEmail(txtEmail.Text); myVenue.setPassword(txtPassword.Text); if (!myVenue.isRegisteredWithID()) { //Ask user to confirm DialogResult confirmation = MessageBox.Show("The new Venue details you have entered are: \n" + myVenue.toString() + "\n\nWould you like to update this venue?,", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (confirmation == DialogResult.Yes) { myVenue.updateVenue(); MessageBox.Show("Your venue details have been updated.", "Venue Updated!", MessageBoxButtons.OK, MessageBoxIcon.Information); //Reset UI //Reset Combo Box txtVenueName.Clear(); txtStreet.Clear(); txtTown.Clear(); txtCapacity.Clear(); txtContactNo.Clear(); txtEmail.Clear(); txtPassword.Clear(); cboVenueNames.SelectedIndex = -1; cboVenueNames.Focus(); pnlUpdateVenue.Visible = false; } } else { MessageBox.Show("Venue Name already exists", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtVenueName.Clear(); txtVenueName.Focus(); return; } } else { MessageBox.Show("Information Missing", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); txtStreet.Focus(); return; } }