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 }); }
protected virtual CustomerParty GetBuyerCustomerParty(ActiveCommerce.Orders.Legacy.Order source) { Assert.ArgumentNotNull(source, "source"); Assert.IsNotNull(source.CustomerInfo, "customerinfo"); var customerParty = OrderFactory.CreateCustomerParty(); var party = OrderFactory.CreateParty(); var contact = OrderFactory.CreateContact(); var list = new List <Sitecore.Ecommerce.Common.Communication>(); if (!string.IsNullOrEmpty(source.CustomerInfo.Email2)) { var communication = OrderFactory.CreateCommunication(); communication.Channel = source.CustomerInfo.Email2; communication.Value = source.CustomerInfo.Email2; communication.Contact = contact; list.Add(communication); } if (!string.IsNullOrEmpty(source.CustomerInfo.Mobile)) { var communication = OrderFactory.CreateCommunication(); communication.Channel = source.CustomerInfo.Mobile; communication.Value = source.CustomerInfo.Mobile; communication.Contact = contact; list.Add(communication); } if (list.Any()) { contact.OtherCommunications = list; } contact.Name = GetFullName(source.CustomerInfo.BillingAddress); contact.ElectronicMail = source.CustomerInfo.Email; contact.Telefax = source.CustomerInfo.Fax; contact.Telephone = source.CustomerInfo.Phone; contact.ID = source.CustomerInfo.CustomerId; var nickName = Sitecore.Context.Domain.GetShortName(source.CustomerInfo.NickName); if (!string.IsNullOrEmpty(nickName) && nickName != Sitecore.Constants.AnonymousUserName) { contact.UserName = source.CustomerInfo.NickName; } party.Contact = contact; party.PostalAddress = GetAddress(source.CustomerInfo.BillingAddress); party.PartyName = GetFullName(source.CustomerInfo.BillingAddress); party.LanguageCode = Sitecore.Context.Language.Name; party.Person = GetPerson(source.CustomerInfo.BillingAddress); customerParty.Party = party; customerParty.SupplierAssignedAccountID = source.CustomerInfo.CustomerId; return(customerParty); }