Package moblima.control.handlers
Class BookingHandler
java.lang.Object
moblima.control.handlers.ShowtimeHandler
moblima.control.handlers.CinemaHandler
moblima.control.handlers.BookingHandler
The type Booking handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Bookings.protected static final ReviewHandler
The constant movieHandler.protected int
The Selected booking idx.Fields inherited from class moblima.control.handlers.CinemaHandler
cinemas, cineplexCodes, selectedCinemaIdx
Fields inherited from class moblima.control.handlers.ShowtimeHandler
selectedShowtimeIdx, showtimes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addBooking
(String customerId, int cinemaId, int movieId, String showtimeId, List<int[]> seats, double totalPrice, Booking.TicketType type) Add booking int.boolean
checkIfCinemaHasBooking
(int cinemaId) Check if cinema has booking boolean.boolean
checkIfShowtimeHasBooking
(String showtimeId) Check if showtime has booking boolean.getBooking
(int bookingIdx) Gets booking.getBooking
(String transactionId) Gets booking.Gets bookings.getBookings
(String customerId) Gets bookings.printBooking
(String transactionId) Print booking.protected boolean
Save bookings boolean.void
setSelectedBookingIdx
(int selectedBookingIdx) Sets selected booking idx.Methods inherited from class moblima.control.handlers.CinemaHandler
addCinema, addCineplexCode, addShowtime, addShowtimes, checkClashingShowtime, generateCinemas, generateShowtimes, getCinema, getCinemaIdx, getCinemas, getCinemaShowtimes, getCineplexCinemas, getCineplexCodes, getShowtimeCinema, getShowtimes, printCineplex, printedShowtime, removeCinema, saveCinemas, setSelectedCinemaId, updateCinema, updateShowtime
Methods inherited from class moblima.control.handlers.ShowtimeHandler
assignSeat, assignSeat, bulkAssignSeat, getAvailableSeatCount, getShowtime, getShowtime, getShowtimeIdx, getShowtimes, printSeats, printSeats, printShowtimeDetails, removeShowtime, saveShowtimes, setSelectedShowtimeIdx, updateShowtimeSeats
-
Field Details
-
reviewHandler
The constant movieHandler. -
bookings
The Bookings. -
selectedBookingIdx
protected int selectedBookingIdxThe 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
Gets booking.- Parameters:
bookingIdx
- the booking idx- Returns:
- the booking
-
getBooking
Gets booking.- Parameters:
transactionId
- the transaction id- Returns:
- the booking
-
getBookings
Gets bookings.- Returns:
- the bookings
-
getBookings
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 idcinemaId
- the cinema idmovieId
- the movie idshowtimeId
- the showtime idseats
- the seatstotalPrice
- the total pricetype
- the type- Returns:
- the int
-
checkIfShowtimeHasBooking
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
Print booking.- Parameters:
transactionId
- the transaction id- Returns:
- the string
-
saveBookings
protected boolean saveBookings()Save bookings boolean.- Returns:
- the boolean
-