Ejemplo n.º 1
0
    def get_projection(cls, tickets):
        projection_id = custom_input(
            "Step 3 (Projection): Choose a projection> ")
        while (not cls.controller.check_movie_projection(
                projection_id, tickets)):
            projection_id = custom_input(
                "Step 3 (Projection): Choose a projection> ")

        print("Available seats (marked with a dot): \n")
        cls.controller.show_projection_spots(projection_id)
        return projection_id
Ejemplo n.º 2
0
    def log_user(cls):
        print("You need to a user in the system to make reservations!")
        username = custom_input("Username: "******"Password: "******"Minimum 8 symbols and number, symbol, capital leter!")
            password = custom_input("Password: "******"Hello, {username}")
Ejemplo n.º 3
0
    def get_seats(cls, tickets, projection_id):
        count = 0
        seats = []
        while count < int(tickets):
            seat = custom_input(f"Step 4 (Seats): Choose seat {count + 1}> ")
            if seat == "give up":
                cls.controller.give_up()
                break

            s = (int(seat.split(', ')[0]), int(seat.split(', ')[1]))
            try:
                cls.controller.create_reservation(projection_id, s[0], s[1])
            except (NotValidSeat, SeatNotInRange) as e:
                print(e)
            else:
                seats.append(seat)
                count += 1

        print("This is your reservation: ")
        cls.controller.show_projection_info(projection_id, seats)
Ejemplo n.º 4
0
    def get_tickets(cls):
        tickets = custom_input("Step 1 (User): Choose number of tickets> ")

        print("Current movies: \n")
        cls.controller.show_movies()
        return tickets
Ejemplo n.º 5
0
    def get_movie(cls):
        movie_id = custom_input("Step 2 (Movie): Choose a movie> ")

        print("Projections for movie: \n")
        cls.controller.show_movie_projections_with_avaliable_seats(movie_id)
        return movie_id