Пример #1
0
        /// <summary>
        /// digging OrderItems details
        /// </summary>
        /// <param name="orderView"></param>
        private void LoadPreOrderDetails(MyHLShoppingCartView orderView)
        {
            if (_orderChinaProviderLoader == null)
                _orderChinaProviderLoader = new OrderChinaProviderLoader();

            var orderDetails = _orderChinaProviderLoader.GetPreOrderDetail(orderView.DistributorID, orderView.OrderHeaderId);
            var shippingInfo = (ShippingInfo_V01)orderDetails.Shipment;
            if (shippingInfo != null && shippingInfo.Address != null)
            {
                orderView.Recipient = shippingInfo.Recipient;
                orderView.Address = shippingInfo.Address.Line1 + shippingInfo.Address.City + shippingInfo.Address.CountyDistrict;
                orderView.AddressValue = ObjectMappingHelper.Instance.GetToShipping(shippingInfo.Address);
            }

            var items = orderDetails.OrderItems;
            if (items != null)
            {
                var cartItems = (from OrderItem_V02 item in items
                                 select
                                     new MyHLProductItemView()
                                     {
                                         Quantity = item.Quantity,
                                         SKU = item.SKU,
                                         Description = item.Description,
                                         RetailPrice = item.RetailPrice
                                     }).ToList();

                orderView.CartItems = cartItems;
            }
        }
Пример #2
0
 public MyHLShoppingCartView(IChinaInterface chinaOrderProxy,
                                ICatalogProviderLoader catalogProviderLoader = null,
                                IOrderChinaProviderLoader orderChinaProviderLoader = null)
 {
     _chinaOrderProxy = chinaOrderProxy;
     _catalogProviderLoader = catalogProviderLoader;
     _orderChinaProviderLoader = orderChinaProviderLoader;
 }