コード例 #1
0
        public static void YNChoice(List <string> choicedSeat, Schedules sch, string map, Reservation res)
        {
            ScheduleBL    schedule = new ScheduleBL();
            ReservationBL reser    = new ReservationBL();

            Console.Write($"\n                      ^: Bạn muốn đặt vé không   (Y/N) : ");
            char tiep = ' ';

            do
            {
                tiep = Tieptuc(tiep);
                switch (tiep)
                {
                case 'Y':
                    reser.InsertIntoReservation(res);
                    schedule.BuySeats(sch, map);
                    InformationTickets(res, 0);
                    break;

                case 'y':
                    reser.InsertIntoReservation(res);
                    schedule.BuySeats(sch, map);
                    InformationTickets(res, 0);
                    break;

                case 'N':
                    ComeBackMenu(sch, 0);
                    break;

                case 'n':
                    ComeBackMenu(sch, 0);
                    break;
                }
            } while (tiep != 'Y' && tiep != 'N' && tiep != 'y' && tiep != 'n');
        }
コード例 #2
0
    public void BuySeatsTestTrue()
    {
        DateTime date = new DateTime(2018, 7, 20);
        TimeSpan time = new TimeSpan(8, 0, 0);

        Schedules schedu = new Schedules(1, 1, 1, date, time, time, "MapSeat", 45000);

        Assert.True(sch.BuySeats(schedu, "A B C D F E G H J K L M;10;"));
    }