public void DisplayMatchDetails(Customer customer)
        {
            MatchBL mbl = new MatchBL();
            List <Persistence.Match> listm = new List <Persistence.Match>();

            try
            {
                listm = mbl.GetListMatchDetail();
            }
            catch (Exception)
            {
                Console.Write("Loi!! Nhan phim bat ki de tro lai man hinh dang nhap!");
                Console.ReadKey();
                m.LoginInterface();
            }
            if (listm.Count != 0)
            {
                var table = new ConsoleTable("Ma Tran", "Ten Tran", "Gio Thi Dau", "Ngay Thi Dau", "San Van Dong");
                foreach (var item in listm)
                {
                    table.AddRow(item.MatchID, item.MatchName, item.MatchTime, String.Format("{0:dd/MM/yyyy}", item.MatchDay), item.MatchStadium);
                }
                table.Write(Format.Default);
            }
        }
Exemplo n.º 2
0
        public void PrintBill(Customer customer, int orderID, double totaldue)
        {
            int    count = 0;
            Order  order = new Order();
            string line1 = "--------------------------------------------------------------------------------------------------------------------";
            string line2 = "====================================================================================================================";

            try
            {
                OrderBL orderbl = new OrderBL();
                order = orderbl.GetOrderInfoByOrderID(orderID);
            }
            catch (Exception)
            {
                Console.WriteLine("Loi!! An phim bat ky de tro ve man hinh dang nhap!");
                Console.ReadKey();
                m.LoginInterface();
            }
            try
            {
                OrderBL orderbl = new OrderBL();
                order.listticket = orderbl.GetListTicketByOrderID(orderID);
            }
            catch (Exception)
            {
                Console.WriteLine("Loi!! An phim bat ky de tro ve man hinh dang nhap!");
                Console.ReadKey();
                m.LoginInterface();
            }
            if (order.listticket.Count != 0)
            {
                Console.WriteLine(line2);
                Console.WriteLine("------------------------------------------------------Hoa Don-------------------------------------------------------");
                Console.WriteLine(line2);
                Console.WriteLine("Ma hoa don:{0,-59}", order.OrderID);
                Console.WriteLine("Ngay mua:{0,-61}", String.Format("{0:dd/MM/yyyy}", order.OrderDate));
                Console.WriteLine(line1);
                Console.WriteLine("Don Vi Ban Ve:CLB Bong Da HAGL");
                Console.WriteLine("Dia Chi:Thanh Pho Pleiku,Tinh Gia Lai");
                Console.WriteLine(line1);
                Console.WriteLine("Ten khach hang: {0,-54}", customer.CusName);
                Console.WriteLine("So dien thoai: {0,-55}", customer.CusPhone);
                Console.WriteLine("Dia chi: {0,-54}", customer.CusAddress);
                Console.WriteLine(line1);
                var table = new ConsoleTable("STT", "Ma Ve", "Mo ta", "So luong", "Don gia", "Thanh tien");
                foreach (var item in order.listticket)
                {
                    string price      = pricevalid(item.TicketPrice);
                    string totalprice = pricevalid((item.TicketPrice * item.Amount));
                    table.AddRow(count += 1, item.TicketID, string.Concat("Ve Loai ", item.TicketType, " Tran ", item.M.MatchName), item.Amount, price, totalprice);
                }
                table.Write(Format.Default);
                Console.WriteLine(line1);
                Console.WriteLine("Tong Tien(VND):{0,-55}", pricevalid(totaldue));
                if (order.OrderStatus == 0)
                {
                    Console.WriteLine("Xac Nhan:Da Thanh Toan.");
                }
                Console.WriteLine(line1);
                Console.WriteLine(line2);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Menus m = new Menus();

            m.LoginInterface();
        }