Class BookingHandler


public class BookingHandler extends CinemaHandler
The type Booking handler.
  • Field Details

    • reviewHandler

      protected static final ReviewHandler reviewHandler
      The constant movieHandler.
    • bookings

      protected List<Booking> bookings
      The Bookings.
    • selectedBookingIdx

      protected int selectedBookingIdx
      The Selected booking idx.
  • Constructor Details

    • BookingHandler

      public BookingHandler()
      Instantiates a new Booking handler.
  • Method Details

    • setSelectedBookingIdx

      public void setSelectedBookingIdx(int selectedBookingIdx)
      Sets selected booking idx.
      Parameters:
      selectedBookingIdx - the selected booking idx
    • getBooking

      public Booking getBooking(int bookingIdx)
      Gets booking.
      Parameters:
      bookingIdx - the booking idx
      Returns:
      the booking
    • getBooking

      public Booking getBooking(String transactionId)
      Gets booking.
      Parameters:
      transactionId - the transaction id
      Returns:
      the booking
    • getBookings

      public List<Booking> getBookings()
      Gets bookings.
      Returns:
      the bookings
    • getBookings

      public List<Booking> getBookings(String customerId)
      Gets bookings.
      Parameters:
      customerId - the customer id
      Returns:
      the bookings
    • addBooking

      public int addBooking(String customerId, int cinemaId, int movieId, String showtimeId, List<int[]> seats, double totalPrice, Booking.TicketType type)
      Add booking int.
      Parameters:
      customerId - the customer id
      cinemaId - the cinema id
      movieId - the movie id
      showtimeId - the showtime id
      seats - the seats
      totalPrice - the total price
      type - the type
      Returns:
      the int
    • checkIfShowtimeHasBooking

      public boolean checkIfShowtimeHasBooking(String showtimeId)
      Check if showtime has booking boolean.
      Parameters:
      showtimeId - the showtime id
      Returns:
      the boolean
    • checkIfCinemaHasBooking

      public boolean checkIfCinemaHasBooking(int cinemaId)
      Check if cinema has booking boolean.
      Parameters:
      cinemaId - the cinema id
      Returns:
      the boolean
    • printBooking

      public String printBooking(String transactionId)
      Print booking.
      Parameters:
      transactionId - the transaction id
      Returns:
      the string
    • saveBookings

      protected boolean saveBookings()
      Save bookings boolean.
      Returns:
      the boolean