コード例 #1
0
 public void GetScheduleByIdTest()
 {
     Assert.NotNull(sch.GetScheduleByIdSchedule(1));
 }
コード例 #2
0
        public static void InformationTickets(Reservation res, int count)
        {
            ScheduleBL sch        = new ScheduleBL();
            Schedules  schedule   = sch.GetScheduleByIdSchedule(res.Schedule_id);
            MoviesBL   movie      = new MoviesBL();
            Movies     informatin = movie.getMovieById(schedule.Movie_id);
            RoomBL     room       = new RoomBL();
            Rooms      ro         = room.GetRoomById(schedule.Room_id);
            string     timeshow   = ShowDay(schedule.Show_date, schedule.Start_time, schedule.End_time);

            Console.Clear();
            Console.WriteLine($"                   ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-++++");
            Console.WriteLine($"                   |                           √√ VÉ ĐẶT TRƯỚC √√                                 |");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |                                                                              |");
            try
            {
                Console.WriteLine($"                   |   • Khánh Hàng : {String.Format(UserInterface.LoginCinema.GetCustomer ().Name),-20}  • SĐT {String.Format(UserInterface.LoginCinema.GetCustomer ().Phone),-31} |");
            }
            catch (System.Exception)
            {
                Console.WriteLine($"                   |   • Khánh Hàng : {String.Format(Login.GetCustomer1 ().Name),-20}  • SĐT {String.Format(Login.GetCustomer1 ().Phone),-31} |");
            }
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |   • Mẫu số : 01/VE2/003                • Ký Hiệu  : MT/17T                   |");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |   • Số vé : {res.Code_ticket,-6}                   • MST : 0303675393-001                |");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |  CÔNG TY TNHH CINEMA MẠNH ĐẠT - CHI NHÁNH HÀ NỘI                             |");
            Console.WriteLine($"                   |  Toà nhà VTC, Số 18 đường Tam Trinh  quận Hai Bà Trưng, thành phố Hà Nội     |");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |  ............................................................................|");
            Console.WriteLine($"                   |                                                                              |");
            if (count == 0)
            {
                Console.WriteLine($"                   |   CIMENA THẾ GIỚI {DateTime.Now} BOX1 ONLINE                            |");
            }
            else
            {
                Console.WriteLine($"                   |   CIMENA THẾ GIỚI {res.Create_on} BOX1 ONLINE                           |");
            }
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |  ============================================================================|");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |   √ {string.Format ($"{informatin.Name.ToUpper (),-73}")}|");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |   √ Thời gian chiếu :   {string.Format ($"{timeshow,-53}")}|");
            Console.WriteLine($"                   |                                                                              |");

            Console.Write($"                   |   √ Phòng chiếu     : {string.Format ($"{ro.Name,-6}")}    Ghế   ");
            string[] arraySeat = res.Seats.Trim().Split(" ");
            int      dem       = 0;

            for (int i = 0; i < arraySeat.Length; i++)
            {
                dem++;
                Console.Write($"{arraySeat[i]} :  {Tien(PaymentFare(arraySeat[i]).ToString())} VND  ");
                if (dem == 2)
                {
                    dem = 0;
                }
                if ((i + 1) % 2 == 0)
                {
                    Console.Write("   |\n                   |                                       ");
                }
            }

            if (dem == 1)
            {
                Console.WriteLine("                     |");
            }
            else
            {
                Console.WriteLine("                                       |");
            }
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |  ============================================================================|");
            Console.WriteLine($"                   |                                                                              |");
            Console.WriteLine($"                   |   √ Giá Tiền                                   VND   {Tien(res.Price.ToString()),-15}         | ");
            Console.WriteLine($"                   |                                                (Đã bao gồm 5% VAT)           |");
            Console.WriteLine($"                   ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-++++");
            Console.WriteLine($"                     ____________________________________________________________________________");
            if (count == 0)
            {
                Console.WriteLine();
                Console.WriteLine($"                          #: Vui lòng nhớ số điện thoại và số vé để đối chiếu                    ");
                Console.WriteLine($"                          #: Quý khánh vui lòng đến trước suất chiếu 15 phút để lấy vé           ");
                Console.WriteLine($"                             Quá thời gian lấy vé, chúng tôi sẽ không hoàn lại tiền vé của bạn   ");
                Console.WriteLine($"                             và vé đặt sẽ tự động bị huỷ.                                        ");
                Console.WriteLine($"                     ____________________________________________________________________________");
                ComeBackMenu(schedule, 1);
            }
            else
            {
                return;
            }
        }
コード例 #3
0
        public void HistoryBookingTicket()
        {
            ReservationBL reser = new ReservationBL();

            // List<Reservation> list = null;
            try {
                List <Reservation> list = reser.GetReservationByCustomerId(UserInterface.LoginCinema.GetCustomer().Customer_id);
                if (list.Count == 0 || list == null)
                {
                    Console.WriteLine("Bạn chưa có giao dịch nào với Rạp Thế Giới ! Đặt vé ngay bạn yêu nhé.");
                    Console.WriteLine("Nhập <Enter> để trở lại.");
                    Console.ReadLine();
                    return;
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("                              Thông tin vé đặt trước  ");
                    Console.WriteLine("                             _________________________");
                    Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
                    Console.WriteLine("STT   | Tên Phim                 | Ngày Chiếu               | Số Lượng (V-T)    |Giá Tiền ");
                    Console.WriteLine("_____________________________________________________________________________________________");

                    for (int i = 0; i < list.Count; i++)
                    {
                        ScheduleBL sch        = new ScheduleBL();
                        Schedules  schedule   = sch.GetScheduleByIdSchedule(list[i].Schedule_id);
                        MoviesBL   movie      = new MoviesBL();
                        Movies     informatin = movie.getMovieById(schedule.Movie_id);
                        string     start1     = string.Format("{0:D2}:{1:D2}", schedule.Start_time.Hours, schedule.Start_time.Minutes);
                        string     end1       = string.Format("{0:D2}:{1:D2}", schedule.End_time.Hours, schedule.End_time.Minutes);
                        string     time       = schedule.Show_date.ToString($"{schedule.Show_date:dd/MM/yyyy}");
                        string     datetime   = time + " " + start1 + " - " + end1;
                        string[]   a          = list[i].Seats.Trim().Split(" ");

                        string format = string.Format($"{i+1,-6}| {informatin.Name,-25}| {datetime,-25}| {CheckCount(a),-18}|{ChoiceMapSeats.Tien (list[i].Price.ToString ()),-9} VND");
                        Console.WriteLine(format);
                        Console.WriteLine("");
                    }
                    Console.WriteLine("_____________________________________________________________________________________________");
                    Console.WriteLine("\n\n\n0. Quay lại.");
                    Console.WriteLine("*: Nhập số thứ tự để xem chi tiết vé .");
                    Console.WriteLine("---------------------------------------------------------------------------------------------");
                    Console.Write("#Chọn :  ");
                    int number;
                    while (true)
                    {
                        bool isINT = Int32.TryParse(Console.ReadLine(), out number);
                        if (!isINT)
                        {
                            Console.WriteLine("Giá trị sai vui lòng nhập lại. ");
                            Console.Write("#Chọn: ");
                        }
                        else if (number < 0 || number > list.Count)
                        {
                            Console.WriteLine($"Giá trị sai vui lòng nhập lại 0 -> {list.Count}.");
                            Console.Write("#Chọn : ");
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (number == 0)
                    {
                        return;
                    }
                    ChoiceMapSeats.InformationTickets(list[number - 1], 1);
                    Console.Write("                   Nhập <Enter> để trở lại.");
                    Console.ReadLine();
                    return;
                }
            } catch (System.Exception) {
                List <Reservation> list = reser.GetReservationByCustomerId(Login.GetCustomer1().Customer_id);
                if (list.Count == 0 || list == null)
                {
                    Console.WriteLine("Bạn chưa có giao dịch nào với Rạp Thế Giới ! Đặt vé ngay bạn yêu nhé.");
                    Console.WriteLine("Nhập <Enter> để trở lại.");
                    Console.ReadLine();
                    return;
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("                              Thông tin vé đặt trước  ");
                    Console.WriteLine("                             _________________________");
                    Console.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
                    Console.WriteLine("STT   | Tên Phim                 | Ngày Chiếu               | Số Lượng (V-T)    |Giá Tiền ");
                    Console.WriteLine("_____________________________________________________________________________________________");

                    for (int i = 0; i < list.Count; i++)
                    {
                        ScheduleBL sch        = new ScheduleBL();
                        Schedules  schedule   = sch.GetScheduleByIdSchedule(list[i].Schedule_id);
                        MoviesBL   movie      = new MoviesBL();
                        Movies     informatin = movie.getMovieById(schedule.Movie_id);
                        string     start1     = string.Format("{0:D2}:{1:D2}", schedule.Start_time.Hours, schedule.Start_time.Minutes);
                        string     end1       = string.Format("{0:D2}:{1:D2}", schedule.End_time.Hours, schedule.End_time.Minutes);
                        string     time       = schedule.Show_date.ToString($"{schedule.Show_date:dd/MM/yyyy}");
                        string     datetime   = time + " " + start1 + " - " + end1;
                        string[]   a          = list[i].Seats.Trim().Split(" ");

                        string format = string.Format($"{i+1,-6}| {informatin.Name,-25}| {datetime,-25}| {CheckCount(a),-18}|{ChoiceMapSeats.Tien (list[i].Price.ToString ()),-9} VND");
                        Console.WriteLine(format);
                        Console.WriteLine("");
                    }
                    Console.WriteLine("_____________________________________________________________________________________________");
                    Console.WriteLine("\n\n\n0. Quay lại.");
                    Console.WriteLine("*: Nhập số thứ tự để xem chi tiết vé .");
                    Console.WriteLine("---------------------------------------------------------------------------------------------");
                    Console.Write("#Chọn :  ");
                    int number;
                    while (true)
                    {
                        bool isINT = Int32.TryParse(Console.ReadLine(), out number);
                        if (!isINT)
                        {
                            Console.WriteLine("Giá trị sai vui lòng nhập lại. ");
                            Console.Write("#Chọn: ");
                        }
                        else if (number < 0 || number > list.Count)
                        {
                            Console.WriteLine($"Giá trị sai vui lòng nhập lại 0 -> {list.Count}.");
                            Console.Write("#Chọn : ");
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (number == 0)
                    {
                        return;
                    }
                    ChoiceMapSeats.InformationTickets(list[number - 1], 1);
                    Console.Write("                   Nhập <Enter> để trở lại.");
                    Console.ReadLine();
                    return;
                }
            }
        }