コード例 #1
0
 public static void removeTheDate() {
   System.out.println("Schedule " + currentMovie.getTitle() + " :");
   currentMovie.getListDateStatusMovie();
   System.out.println("\n");
   ArrayList<DateMovie> listMovie = currentMovie.getArrayListOfDateMovie();
   System.out.println("Please choose which date you want to configure");
   int indexListMovie = scan.nextInt();
   DateMovie currentDate = listMovie.get(indexListMovie - 1);
   listMovie.remove(currentDate);
 }
コード例 #2
0
 private static void editStatusTimeCinema() {
   System.out.println("Schedule " + currentMovie.getTitle() + " :");
   currentMovie.getListDateStatusMovie();
   System.out.println("\n");
   ArrayList<DateMovie> listMovie = currentMovie.getArrayListOfDateMovie();
   System.out.println("Please choose which date you want to configure");
   int indexListMovie = scan.nextInt();
   DateMovie currentDate = listMovie.get(indexListMovie - 1);
   System.out.println(
       "\nPlease choose which one you want to edit on " + currentDate.getStatusTimeMovie());
   System.out.println("1) Time");
   System.out.println("2) status");
   System.out.println("3) cinema");
   int timestatus = scan.nextInt();
   if (timestatus == 1) {
     editTime(listMovie.get(indexListMovie - 1));
   } else if (timestatus == 2) {
     System.out.println("insert the new Status");
     scan.nextLine();
     String newStatus = chooseStatusMovie();
     currentDate.setStatus(newStatus);
     if (!newStatus.equals("Coming Soon")) {
       movieRated.addMovieList(currentMovie);
     }
   } else if (timestatus == 3) {
     System.out.println("List Cinema: ");
     int choosenCinema = getIndexCinema();
     currentDate.setCinema(currentCineplex.getCinema(choosenCinema - 1));
   } else {
     System.out.println("Sorry your choice is not listed in the system");
     System.out.println("Please choose the below option");
     System.out.println("1) Quit to Date configuration");
     System.out.println("2) Editing Date attribute again");
     int option = scan.nextInt();
     if (option == 1) {
       return;
     } else if (option == 2) {
       System.out.println("");
       editStatusTimeCinema();
       return;
     }
     return;
   }
 }