//End constructor private void frmLoginRegister_Load(object sender, EventArgs e) { //Start instantations encryptionController = new frmEncryptionController(); reservationController = new frmReservationController(this); //End instantiations }
//End constructor private void frmMakeReservation_Load(object sender, EventArgs e) { //Start instantiation movieController = new frmMovieController(this, gridMovie); reserveController = new frmReservationController(gridMovie, this); showController = new frmShowController(this, gridShow); seatController = new frmSeatController(this); //End instantiation //Display movie details in the grid movieController.displayGrid(); //Format movie grid //Does not allow changes to be made. gridMovie.ReadOnly = true; //Hides column movie id gridMovie.Columns[0].Visible = false; //Formats the date time picker. formatDTP(); //Disbale date time picker, button and combobox btnConfirmDateTime.Enabled = false; dtpDate.Enabled = false; cmbTime.Enabled = false; //Displays the first movie as being selected. lblSelectedMovie.Text = "Selected Movie: " + gridMovie.Rows[0].Cells[1].Value; }
//End variables //Constructor public frmReservationDetails(int reservationID) { InitializeComponent(); this.reservationID = reservationID; //Start instantiation reservationController = new frmReservationController(this, reservationID); ticketController = new frmTicketController(this, gridTicket, reservationID); showController = new frmShowController(this, gridShow, reservationID); seatController = new frmSeatController(this, reservationID); //End instantiation }
//End variables //Constructor public frmReservationConfirmed(List<int> seatID, int customerID, int showID) { InitializeComponent(); this.seatID = seatID; this.customerID = customerID; this.showID = showID; //Start instantiations reservationController = new frmReservationController(this, customerID, seatID, showID); ticketController = new frmTicketController(this, seatID, showID, customerID, gridTicket); seatController = new frmSeatController(this, seatID, showID); showController = new frmShowController(this, showID); //End instantiations }
//End variables //Constructor public frmTicketController(MetroForm form, List<int> seatID, int showID, int customerID, MetroGrid grid) { this.showID = showID; this.seatID = seatID; this.form = form; this.grid = grid; this.customerID = customerID; //Start instantiations reservationController = new frmReservationController(form, customerID, seatID, showID); reservation = new Reservation(customerID, DateTime.Now.Date); database = new Database(form); ticket = new Ticket(); //End instantiations }
//End constructor //Validate reservation ID private void btnCheck_Click(object sender, EventArgs e) { //Checks to see if it is emtpy if(txtReservationID.Text != "") { try { //Checks to see if it is a number int.Parse(txtReservationID.Text); reservationController = new frmReservationController(this, Convert.ToInt32(txtReservationID.Text)); //Checks to see if the reservation ID exists. if (reservationController.checkReservationID()) { this.Hide(); frmLogin = new frmLogin(Convert.ToInt32(txtReservationID.Text)); frmLogin.ShowDialog(); //Display login form txtReservationID.Clear(); //Clears all values entered in the reservation ID text box this.Show(); } //Reservation ID does not exist else { MetroMessageBox.Show(this, "Please re-enter your reservation ID.\nThat reservation ID does not exist.", "Invalid reservation ID", MessageBoxButtons.OK, MessageBoxIcon.Error); txtReservationID.Clear(); } } //Reservation ID is not a number catch { MetroMessageBox.Show(this, "Please re-enter your reservation ID.\n- Reservation ID has to be a number.", "Invalid reservation ID.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } //Empty textbox else { MetroMessageBox.Show(this, "Please re-enter your reservation ID.\n- Reservation ID is empty.", "Invalid reservation ID", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//End constructor private void frmLogin_Load(object sender, EventArgs e) { reservationController = new frmReservationController(this); //Instantiate reservation controller. }