Exemplo n.º 1
0
        public void Display()
        {
            Console.Clear();
            IView orderListView = new OrderListView(myOrder);

            Console.WriteLine("Current Order: ");
            orderListView.Display();
            Console.WriteLine("\n1: Add an Item");
            Console.WriteLine("2: Remove an Item");
            Console.WriteLine("3: Cancel Order");
            Console.WriteLine("4: Proceed to Checkout");
            Console.Write("\nMake a slection(1-4): ");
        }
Exemplo n.º 2
0
        public void Display()
        {
            Console.Clear();
            int headerSpacing = 20;

            if (myOrder.PayInfo.PayType == PayType.Cash)
            {
                Console.Write($"RSJ Coffee House\t\tOrder Number: {myOrder.OrderNumber}");
                Console.WriteLine($"\nDate: {DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")}");
                Console.WriteLine();
                IView orderListView = new OrderListView(myOrder);
                orderListView.Display();
                Console.WriteLine();
                Console.WriteLine($"Subtotal{PrintDots("Subtotal", headerSpacing)}{myOrder.Subtotal:C2}");
                Console.WriteLine($"Tax{PrintDots("Tax", headerSpacing)}{myOrder.Tax:C2}");
                Console.WriteLine($"Total{PrintDots("Total", headerSpacing)}{myOrder.Total:C2}");
                Console.WriteLine($"Amount Tendered{PrintDots("Amount Tendered", headerSpacing)}{myOrder.PayInfo.AmountTendered:C2}");
                Console.WriteLine($"Change{PrintDots("Change", headerSpacing)}{myOrder.PayInfo.Change:C2}");
                Console.WriteLine($"\nThank you for shopping at RSJ Coffee House");
            }
            else if (myOrder.PayInfo.PayType == PayType.Credit)
            {
                Console.Write($"RSJ Coffee House\t\tOrder Number: {myOrder.OrderNumber}");
                Console.WriteLine($"\nDate: {DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")}");
                IView orderListView = new OrderListView(myOrder);
                orderListView.Display();
                Console.WriteLine($"Subtotal{PrintDots("Subtotal", headerSpacing)}{myOrder.Subtotal:C2}");
                Console.WriteLine($"Tax{PrintDots("Tax", headerSpacing)}{myOrder.Tax:C2}");
                Console.WriteLine($"Total{PrintDots("Total", headerSpacing)}{myOrder.Total:C2}");
                Console.WriteLine($"Card Number{PrintDots("Card Number", headerSpacing)}**** **** **** {myOrder.PayInfo.CardNumber.Substring(myOrder.PayInfo.CardNumber.Length -4)}");
                Console.WriteLine($"Amount Tendered{PrintDots("Amount Tendered", headerSpacing)}{myOrder.PayInfo.AmountTendered:C2}");
                Console.WriteLine($"Cash Back{PrintDots("Cash Back", headerSpacing)}{myOrder.PayInfo.CashBack}");
                Console.WriteLine($"\nThank you for shopping at RSJ Coffee House");
            }
            else
            {
                Console.Write($"RSJ Coffee House\t\tOrder Number: {myOrder.OrderNumber}");
                Console.WriteLine($"\nDate: {DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss")}");
                IView orderListView = new OrderListView(myOrder);
                orderListView.Display();
                Console.WriteLine($"Subtotal{PrintDots("Subtotal", headerSpacing)}{myOrder.Subtotal:C2}");
                Console.WriteLine($"Tax{PrintDots("Tax", headerSpacing)}{myOrder.Tax:C2}");
                Console.WriteLine($"Total{PrintDots("Total", headerSpacing)}{myOrder.Total:C2}");
                Console.WriteLine($"Check Number{PrintDots("Check Number", headerSpacing)}{myOrder.PayInfo.CheckNumber}");
                Console.WriteLine($"Amount Tendered{PrintDots("Amount Tendered", headerSpacing)}{myOrder.PayInfo.AmountTendered:C2}");
                Console.WriteLine($"\nThank you for shopping at RSJ Coffee House");
            }

            Console.ReadKey();
        }