示例#1
0
 public static void Show_FilmScreening(Cinema cinema, int numFilm)
 {
     Console.Clear();
     Console.WriteLine("Select movie screening:");
     Console.WriteLine("------------------------------------------------------------------");
     try
     {
         int    i     = 1;
         Hall[] hall1 = CinemaFactory.FillHall_1();
         Hall[] hall2 = CinemaFactory.FillHall_2();
         foreach (FilmScreening filmScreening in cinema.Films[numFilm].FilmScreenings)
         {
             Console.WriteLine("Type of halls: \n");
             Console.WriteLine($"{hall1[0].ToString()}\n{hall2[0].ToString()}\n");
             //Console.WriteLine($"{hall1[0].ToShortString()}\n {hall2[0].ToShortString()}");
             Console.WriteLine("------------------------------------------------------------------");
             Console.WriteLine($"№{i++}:" + " " + filmScreening.ToString());
             //Console.WriteLine(filmScreening.ToShortString());
         }
         int choice = Convert.ToInt32(Console.ReadLine()) - 1;
         if (choice > cinema.Films[numFilm].FilmScreenings.Length - 1 || choice < 0)
         {
             Console.WriteLine("Invalid entry, please try again! Press any key");
             Console.ReadKey();
             Show_FilmScreening(cinema, numFilm);
             return;
         }
         Console.WriteLine("------------------------------------------------------------------");
         Show_Seat(cinema, numFilm, choice);
     }
     catch
     {
         Console.WriteLine("Invalid entry, please try again! Press any key");
         Console.ReadKey();
         Show_FilmScreening(cinema, numFilm);
     }
 }
示例#2
0
        public static void Main(string[] args)
        {
            cinema1 = CinemaFactory.CreateCinema("Multiplex_One", CinemaFactory.FillTheFilms(), CinemaFactory.FillHall_1(), new Ticket[10]);
            cinema2 = CinemaFactory.CreateCinema_2("Multiplex_Two", CinemaFactory.FillTheFilms_2(), CinemaFactory.FillHall_2(), new Ticket[12]);

            Show_MailMenu(cinema1, cinema2);
        }