Пример #1
0
        public virtual cartDto.ShipmentItem ToShipmentItemDto(CartShipmentItem shipmentItem)
        {
            var result = new cartDto.ShipmentItem();

            result.Quantity = shipmentItem.Quantity;
            result.LineItem = shipmentItem.LineItem.ToLineItemDto();

            return(result);
        }
Пример #2
0
        public virtual cartDto.ShipmentItem ToShipmentItemDto(CartShipmentItem webModel)
        {
            var result = new cartDto.ShipmentItem();

            result.InjectFrom <NullableAndEnumValueInjecter>(webModel);

            result.LineItem = webModel.LineItem.ToLineItemDto();

            return(result);
        }
Пример #3
0
        public virtual CartShipmentItem ToShipmentItem(cartDto.ShipmentItem shipmentItemDto, ShoppingCart cart)
        {
            var result = ServiceLocator.Current.GetInstance <CartFactory>().CreateShipmentItem();

            result.InjectFrom <NullableAndEnumValueInjecter>(shipmentItemDto);

            result.LineItem = cart.Items.FirstOrDefault(x => x.Id == shipmentItemDto.LineItemId);

            return(result);
        }
Пример #4
0
        public static cartDto.ShipmentItem ToShipmentItemDto(this CartShipmentItem shipmentItem)
        {
            var result = new cartDto.ShipmentItem
            {
                Quantity = shipmentItem.Quantity,
                LineItem = shipmentItem.LineItem.ToLineItemDto()
            };

            return(result);
        }
Пример #5
0
        public virtual CartShipmentItem ToShipmentItem(cartDto.ShipmentItem shipmentItemDto, ShoppingCart cart)
        {
            var result = new CartShipmentItem();

            result.InjectFrom <NullableAndEnumValueInjecter>(shipmentItemDto);

            result.LineItem = cart.Items.FirstOrDefault(x => x.Id == shipmentItemDto.LineItemId);

            return(result);
        }
Пример #6
0
        public virtual CartShipmentItem ToShipmentItem(cartDto.ShipmentItem shipmentItemDto, ShoppingCart cart)
        {
            var result = new CartShipmentItem();

            result.Quantity = shipmentItemDto.Quantity ?? 0;

            result.LineItem = cart.Items.FirstOrDefault(x => x.Id == shipmentItemDto.LineItemId);

            return(result);
        }
Пример #7
0
        public static CartShipmentItem ToShipmentItem(this cartDto.ShipmentItem shipmentItemDto, ShoppingCart cart)
        {
            var result = new CartShipmentItem
            {
                Quantity = shipmentItemDto.Quantity ?? 0,

                LineItem = cart.Items.FirstOrDefault(x => x.Id == shipmentItemDto.LineItemId)
            };

            return(result);
        }
Пример #8
0
 public static CartShipmentItem ToShipmentItem(this cartDto.ShipmentItem shipmentItemDto, ShoppingCart cart)
 {
     return(CartConverterInstance.ToShipmentItem(shipmentItemDto, cart));
 }