示例#1
0
        //GET: /<controller>/
        public IActionResult Details(int id)
        {
            if (id < 0)
            {
                return(NotFound());
            }
            var orders = _storeRepo.GetCustomerOrders(id);

            return(View(orders));
        }
示例#2
0
        public decimal GetCustomerOrder()
        {
            var customerOrders = storeRepo.GetCustomerOrders(customerId);

            Console.WriteLine("Here are all your orders: ");
            Console.WriteLine();
            Console.WriteLine($"Order Number\t\tProduct Name \t\tQuantity\t\t Location");
            foreach (var order in customerOrders)
            {
                Console.WriteLine($"{order.OrderId}\t\t{order.Product.Name}\t{order.OrderQuantity}\t{order.Location.Name}");
                total += (order.Product.Price * order.OrderQuantity);
            }
            return(total);
        }