Esempio n. 1
0
        public static void DisplayOrders()
        {
            List <Customer> customers     = new List <Customer>();
            CustomerOrder   customerOrder = new CustomerOrder();

            CustomerOrderRepository customerOrderRepository = new CustomerOrderRepository();

            customers = customerOrderRepository.LoadAllCustomers();

            foreach (var cust in customers)
            {
                customerOrder.orders = customerOrderRepository.LoadAllOrders(cust.CustomerId);
                Console.WriteLine("***************************************************");
                Console.WriteLine("Customer Name : " + cust.Name);
                Console.WriteLine("Orders: ");
                foreach (var order in customerOrder.orders)
                {
                    Console.WriteLine("\tOrder ID: " + order.OrderId);
                    Console.WriteLine("\tOrder Amount:" + order.Amount);
                }
            }
        }