Beispiel #1
0
        // Get User order
        static void TakeUserOrder()
        {
            Console.WriteLine("----------------------------------------------");
            string breadPrompt = "Enter the number of loaves your belly desires:";

            DisplayColoredMessage(ConsoleColor.Yellow, breadPrompt);
            newOrder.BreadOrderCount = Int32.Parse(Console.ReadLine());
            Console.WriteLine("----------------------------------------------");
            string pastryPrompt = "Enter the number of pastries your heart desires:";

            DisplayColoredMessage(ConsoleColor.Yellow, pastryPrompt);

            newOrder.PastryOrderCount = Int32.Parse(Console.ReadLine());

            // Set current cost adjustments
            bread.AdjustBreadCost(newOrder.BreadOrderCount);
            pastry.AdjustPastryCost(newOrder.PastryOrderCount);

            //  Calculate current order costs
            bread.CalcBreadTotalCost(newOrder.BreadOrderCount);
            pastry.CalcPastryTotalCost(newOrder.PastryOrderCount);
            newOrder.CalcOrderTotalCost(bread.BreadOrderTotalCost, pastry.PastryOrderTotalCost);
        }