Beispiel #1
0
        private void PrepareOrder(Order order)
        {
            var cooker = new CookingService();

            foreach (var item in order.Items)
            {
                item.MenuItem = cooker.Prepare(item.ItemId);
            }
        }
        private void PrepareOrder(Order order)
        {
            var cooker = new CookingService();

            foreach (var item in order.Items)
            {
                cooker.Prepare(item.ItemId, item.Quantity);
            }
        }
Beispiel #3
0
        public void ExecuteOrder(Order order, PaymentDetails paymentDetails, bool printReceipt)
        {
            order.CalculateAmount();
            paymentService.Charge(paymentDetails, order);
            cookingService.Prepare(order);

            if (printReceipt)
            {
                printer.PrintReceipt(order);
            }
        }