Beispiel #1
0
        public IActionResult Detail(int orderId, int customerId)
        {
            ViewBag.Message = "View Customer Details";

            var order       = orderRepository.GetOrderById(orderId);
            var orderDetail = orderProductRepository.GetOrderProductDetails(orderId);
            var orderAmount = orderRepository.GetOrderTotal(orderId);
            var customer    = customerRepository.GetCustomerById(order.CustomerID);

            if (order == null)
            {
                return(NotFound());
            }

            return(View(new OrderViewModel {
                Order = order,
                OrderProducts = orderDetail,
                TotalOrderAmount = orderAmount,
                Customer = customer
            }));
        }