Exemple #1
0
        private void PrintMenu()
        {
            Console.WriteLine("=====ORDER MENU=====");
            string menuString = "";

            foreach (IOrdable ordable in menu.Ordables)
            {
                menuString += OrdablesToString.OrdableToString(ordable);
            }
            Console.WriteLine(menuString);
        }
Exemple #2
0
        public string GetOrderContentString(Order order)
        {
            string contentString = "";

            if (order != null && order.Content.Count > 0)
            {
                var pizzas = order.Content.Where(item => item is Pizza).ToList();
                foreach (Pizza pizza in pizzas)
                {
                    contentString += OrdablesToString.OrdableToString(pizza);
                }
                var drinks = order.Content.Where(item => item is Drink).ToList();
                foreach (Drink drink in drinks)
                {
                    contentString += OrdablesToString.OrdableToString(drink);
                }
                var extras = order.Content.Where(item => item is Topping).ToList();
                foreach (Topping extra in extras)
                {
                    contentString += OrdablesToString.OrdableToString(extra);
                }
            }
            return(contentString);
        }