Package src.controller
Class CinemaStaffManager
Object
CinemaStaffManager
Controller class for handling all logic related to
CinemaStaff
- Version:
- 1.0
- Author:
- Jonathan Ng
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
configureHoliday
(int choice) Method for cinema staffs to configure the ArrayList of holidays in the databasestatic void
configurePrice
(int choice) Method for cinema staffs to configure thePrices
for various flat prices and rates and updates the databasestatic CinemaStaff
createCinemaStaff
(String name, String password, String username) Method to create cinema staff instance and save it to databasestatic void
movieAdder
(String title, MovieAgeRating movieAgeRating, MovieShowingStatus movieShowingStatus, ArrayList<String> movieCast, String director, String synopsis, double duration, int movieTypeChoice, ArrayList<String> showingVenue, ArrayList<ArrayList<Seat>> seatingPlan, ArrayList<DateTime> showingTime) Method to add a newMovie
into the database and schedule it into the movie schedulerMovieSchedule
static void
optInOut
(int choice, boolean optInOut) Method to opt in/out the permissions of movie goers from viewing the list of top fivestatic void
printHolidayList
(String content) Method to print out the holidays on the holidays ArrayListstatic DateTime
Method to query and create a new datestatic DateTime
Method to query and create a new holidaystatic void
updateExistingMovieDetails
(Movie movie, int detail) Method to update the details for existing movies in the database
-
Constructor Details
-
CinemaStaffManager
public CinemaStaffManager()Constructor
-
-
Method Details
-
createCinemaStaff
Method to create cinema staff instance and save it to database- Parameters:
name
- is the name of the cinema staffpassword
- is the password of the cinema staff's account used during loginusername
- is the username of the cinema staff's account used during login- Returns:
- The created
CinemaStaff
object
-
movieAdder
public static void movieAdder(String title, MovieAgeRating movieAgeRating, MovieShowingStatus movieShowingStatus, ArrayList<String> movieCast, String director, String synopsis, double duration, int movieTypeChoice, ArrayList<String> showingVenue, ArrayList<ArrayList<Seat>> seatingPlan, ArrayList<DateTime> showingTime) Method to add a newMovie
into the database and schedule it into the movie schedulerMovieSchedule
- Parameters:
title
- is the title of the new moviemovieAgeRating
- is the age rating of the new moviemovieShowingStatus
- is the new showing status of the new moviemovieCast
- is all the cast members of the new moviedirector
- is the name of the director of the new moviesynopsis
- is the synopsis of the new movieduration
- is the length of the new moviemovieTypeChoice
- is the choice of the new movie typeshowingVenue
- is all the showing venues of the new movieseatingPlan
- is all the seating plan of the cinema corresponding to the cinema typeshowingTime
- is all the showing times of the movie
-
updateExistingMovieDetails
Method to update the details for existing movies in the database- Parameters:
movie
- is the movie in considerationdetail
- is the particular detail that is to be updated. Cinema staffs are able to configure 1. Movie Title 2. Movie Type 3. Age Rating 4. Showing Status 5. Name of movie casts 6. Name of movie director 7. Synopsis 8. Duration of movie 9. Movie Schedule (Showing venue and Showing time)
-
configurePrice
public static void configurePrice(int choice) Method for cinema staffs to configure thePrices
for various flat prices and rates and updates the database- Parameters:
choice
- is the choice of which price to configure
-
configureHoliday
public static int configureHoliday(int choice) Method for cinema staffs to configure the ArrayList of holidays in the database- Parameters:
choice
- is the choice of whether to add a new holiday or to remove an existing holiday- Returns:
- Integer flag whether the configuration is successful or not
-
printHolidayList
Method to print out the holidays on the holidays ArrayList- Parameters:
content
- is the contents to be printed out
-
queryDate
Method to query and create a new date- Returns:
DateTime
object of the queried date
-
queryHoliday
Method to query and create a new holiday- Returns:
DateTime
object of the queried date
-
optInOut
public static void optInOut(int choice, boolean optInOut) Method to opt in/out the permissions of movie goers from viewing the list of top five- Parameters:
choice
- is the choice whether to opt in/out based on overall ratings or based on movie salesoptInOut
- is the choice whether to opt in or opt out
-