Esempio n. 1
0
        public static void Main(string[] args)
        {
            OrderBuilder builder = new OrderBuilder();

            OrderedItems orderedItems = builder.GetOrdered();

            orderedItems.showItems();

            Console.WriteLine();
            Console.WriteLine("Tong hoa don cua ban la : " + orderedItems.getCost());
            Console.ReadLine();
        }
Esempio n. 2
0
        public OrderedItems GetOrdered()
        {
            Console.WriteLine("Chao mung ban den dich vu su dung ghe tau ngam cua chung toi ");
            OrderedItems itemsOrder = new OrderedItems();

            Console.WriteLine("Enter type of seat ");
            Console.WriteLine("        1. VIP       ");
            Console.WriteLine("        2. Normal   ");
            Console.WriteLine("        3. Exit            ");
            int choiceShit = Convert.ToInt32(Console.ReadLine());

            switch (choiceShit)
            {
            case 1:
                itemsOrder.addItems(new VIP());
                break;

            case 2:
                itemsOrder.addItems(new Normal());
                break;

            case 3:
                break;

            default:
                break;
            }
            Console.WriteLine("Enter the choice of Food ");
            Console.WriteLine("        1. Fast Food       ");
            Console.WriteLine("        2. Soft Drink   ");
            Console.WriteLine("        3. Exit            ");
            int choiceFood = Convert.ToInt32(Console.ReadLine());

            switch (choiceFood)
            {
            case 1:
                Console.WriteLine("You ordered Fast Food ");
                Console.WriteLine("------------------------");
                Console.WriteLine("    1. Burger ");
                Console.WriteLine("    2. Pizza ");
                Console.WriteLine("------------------------");
                int breadSize = Convert.ToInt32(Console.ReadLine());
                switch (breadSize)
                {
                case 1:
                    itemsOrder.addItems2(new Burger());
                    break;

                case 2:
                    itemsOrder.addItems2(new Pizza());
                    break;

                case 3:
                    break;

                default:
                    break;
                }
                break;

            case 2:
                Console.WriteLine("You ordered Soft Drink ");
                Console.WriteLine("------------------------");
                Console.WriteLine("    1. Nuoc Mia ");
                Console.WriteLine("    2. Nuoc Cam ");
                Console.WriteLine("------------------------");
                int pepsySize = Convert.ToInt32(Console.ReadLine());
                switch (pepsySize)
                {
                case 1:
                    itemsOrder.addItems2(new NuocMia());
                    break;

                case 2:
                    itemsOrder.addItems2(new NuocCam());
                    break;

                case 3:
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
            return(itemsOrder);
        }