示例#1
0
        public IActionResult OrderHistoryDetails(int orderId)
        {
            DpdTrackingStatusListViewModel   dpdTrackingStatusViewModel;
            OrderAndOrderDetailListViewModel orderAndOrderDetails;

            try
            {
                dpdTrackingStatusViewModel = _dpdService.GetTrackingStatusFromDPDWebservice(orderId);
            }
            catch
            {
                throw new Exception("Nie udało się pobrać śledzenia przesyłki z serwisu DPD");
            }

            try
            {
                orderAndOrderDetails = new OrderAndOrderDetailListViewModel()
                {
                    OrderDetails = _cartService.GetCartDetailList(orderId),
                    Order        = _customerAccountService.GetOrder(orderId),
                };
            }
            catch
            {
                throw new Exception("Nie powiodło się pobranie zawartości koszyka lub zamówienia");
            }

            OrderAndOrderDetailListAndDpdTrackingStatusViewModel orderAndOrderDetailsAndTrackincStatus = new OrderAndOrderDetailListAndDpdTrackingStatusViewModel()
            {
                OrderAndDetailsOrder  = orderAndOrderDetails,
                DpdTrackingStatusList = dpdTrackingStatusViewModel,
            };

            return(View(orderAndOrderDetailsAndTrackincStatus));
        }
        public IActionResult OrderDetails(int orderId)
        {
            OrderDetailsAndDpdTrackingStatusViewModel orderDetailsAndTracking = new OrderDetailsAndDpdTrackingStatusViewModel()
            {
                DpdTrackingStatusList = _dpdService.GetTrackingStatusFromDPDWebservice(orderId),
                OrderDetails          = _adminService.GetOrderDetails(orderId),
            };

            return(View(orderDetailsAndTracking));
        }