//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;
        }
        private void frmShowMovie_Load(object sender, EventArgs e)
        {
            database = new Database(this);
            movieController = new frmMovieController(this, gridMovie);
            designController = new frmDesignController();

            //Displays information in the movie grid.
            movieController.displayGrid();

            //Hide column movie id.
            gridMovie.Columns[0].Visible = false;

            //Does not allow changes to be made.
            gridMovie.ReadOnly = true;

            //Formats the design of the grid.
            designController.changeFont(gridMovie);
        }
        //Form load event
        private void frmMain_Load(object sender, EventArgs e)
        {
            //Start instantiation
            movieController = new frmMovieController(this, gridMovie);
            designController = new frmDesignController();
            employeeController = new frmEmployeeController(this, gridEmployee);
            customerController = new frmCustomerController(this, gridCustomer);
            validationController = new frmValidationController();
            datePickerController = new frmDatePickerController(gridCustomer);
            frmLogin = new frmLogin();
            overviewController = new frmOverviewController(this, cmbShowTimes);
            //End instantiation

            //Displays information in the grids.
            movieController.displayGrid();
            employeeController.displayGrid();
            customerController.displayGrid();

            //Does not allow changes to be made to certain columns.
            gridMovie.Columns[0].ReadOnly = true; //Movie ID
            gridEmployee.Columns[0].ReadOnly = true; //Employee ID
            gridEmployee.Columns[4].ReadOnly = true; //Employee password
            gridCustomer.Columns[0].ReadOnly = true; //Customer ID
            gridCustomer.Columns[4].ReadOnly = true; //Customer password

            //Format the design of grids.
            designController.changeFont(gridMovie); //Movie grid
            designController.changeFont(gridEmployee); //Employee grid
            designController.changeFont(gridCustomer);  //Customer grid

            //Add items to combo box
            movieController.addItemsToCmb(cmbMovieRating); //Add A, B and C to combo box in movie page.
            overviewController.addItemsToCmb(cmbShowTimes); //Add show times to the combo box in overview page.

            //Add date picker to the grid.
            datePickerController.addDatePicker();

            //Puts focus on first page of tab control.
            tabControl.SelectedTab = tabControl.TabPages["tabPageOverview"];

        }
        //End Constructor

        private void frmReservationConfirmed_Load(object sender, EventArgs e)
        {
            reservationController.createReservation(); //Creates the reservation
            seatController.changeSeatAvailabilityTaken(); //Changes availability of the selected seats to taken
            ticketController.calculateTicketPrice(); //Calculates individual prices of the seats.
            ticketController.displayTickets();  //Displays information of the tickets in the grid ticket
            showController.displayShow(gridShow); //Display show details in the grid show.

            //Gets the total price for the reservation.
            double totalPrice = reservationController.calculateTotalPrice(ticketController.getTotalTicketPrice(), seatController.getNumberOfSeatsReserved(), showController.getMovieRating());

            lblPrice.Text += totalPrice.ToString("c"); //Formats price to currency

            gridTicket.Columns[2].DefaultCellStyle.Format = "£0.00#"; //Formats column "price".

            formatGrid(); //Formats the grids

            //Instantiate movie controller
            movieController = new frmMovieController(this, Convert.ToInt16(gridShow.Rows[0].Cells[1].Value));

            //Displays name of the movie selected.
            lblMovieName.Text = "Movie selected: " + movieController.getMovieName();
        }