private void cboSelectScreening_SelectedIndexChanged(object sender, EventArgs e) { grpScheduleScreening.Visible = true; //if resetting combo, ignore if (cboSelectScreening.SelectedIndex == -1) { return; } //find screen details updScreening = new Screening(); updScreening.getScreening(Convert.ToInt32(cboSelectScreening.Text.Substring(12, 1))); if (updScreening.getScreenNo().Equals(0)) { MessageBox.Show("No details found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //display Screen details txtScreeningNumber.Text = updScreening.getScreeningNo().ToString(); dtpDateFrom.Value = updScreening.getDateFrom(); dtpDateTo.Value = updScreening.getDateTo(); cboTimes.SelectedIndex = updScreening.getTime() - 1; txtseatsAvailable.Text = updScreening.getSeatsAvailable().ToString(); txtMaxSeats.Text = updScreening.getMaxSeats().ToString(); cboScreenNo.SelectedIndex = updScreening.getScreenNo() - 1; cboMovieId.SelectedIndex = updScreening.getMovieId() - 1; }
private void cboSelectScreening_SelectedIndexChanged(object sender, EventArgs e) { grpScheduleScreening.Visible = false; if (Screening.isBooked(cboSelectScreening.Text.Substring(12, 1)) == true) { MessageBox.Show("Screening cannot be removed as it has been booked!"); loadCombo(); return; } grpScheduleScreening.Visible = true; //if resetting combo, ignore if (cboSelectScreening.SelectedIndex == -1) { return; } //find screen details myScreening = new Screening(); myScreening.getScreening(Convert.ToInt32(cboSelectScreening.Text.Substring(12, 1))); if (myScreening.getScreenNo().Equals(0)) { MessageBox.Show("No details found", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } txtScreeningNumber.Text = myScreening.getScreeningNo().ToString(); dtpDateFrom.Value = myScreening.getDateFrom(); dtpDateTo.Value = myScreening.getDateTo(); cboTimes.Text = myScreening.getTime().ToString(); txtseatsAvailable.Text = myScreening.getSeatsAvailable().ToString(); txtMaxSeats.Text = myScreening.getMaxSeats().ToString(); cboScreenNo.Text = myScreening.getScreenNo().ToString(); cboMovieId.Text = myScreening.getMovieId().ToString(); }