Beispiel #1
0
        protected virtual ICollection <Sitecore.Ecommerce.OrderManagement.Orders.Delivery> GetDelivery(ActiveCommerce.Orders.Legacy.Order source, Order order)
        {
            Assert.ArgumentNotNull(source, "source");
            Assert.ArgumentNotNull(order, "order");
            Assert.IsNotNull(source.CustomerInfo, "customerinfo");

            var delivery = OrderFactory.CreateDelivery();
            var party    = OrderFactory.CreateParty();
            var contact  = OrderFactory.CreateContact();

            contact.Name      = GetFullName(source.CustomerInfo.ShippingAddress);
            contact.Telephone = source.CustomerInfo.ShippingAddress.GetPhoneNumber();

            party.Contact       = contact;
            party.PostalAddress = GetAddress(source.CustomerInfo.ShippingAddress);
            party.Person        = GetPerson(source.CustomerInfo.ShippingAddress);
            party.PartyName     = GetFullName(source.CustomerInfo.ShippingAddress);

            delivery.Order         = order;
            delivery.DeliveryParty = party;

            return(new Collection <Sitecore.Ecommerce.OrderManagement.Orders.Delivery> {
                delivery
            });
        }