/// <summary> /// Initializes a new instance of the <see cref="TranslateEntityToOrderAddressRequest"/> class. /// </summary> /// <param name="sourceParty">The source party.</param> /// <param name="destinationAddress">The destination address.</param> public TranslateEntityToOrderAddressRequest([NotNull] Party sourceParty, [NotNull] OrderAddress destinationAddress) { Assert.ArgumentNotNull(sourceParty, "sourceParty"); Assert.ArgumentNotNull(destinationAddress, "destinationAddress"); this.SourceParty = sourceParty; this.DestinationAddress = destinationAddress; }
/// <summary> /// Translates to email party. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected virtual void TranslateToEmailParty(CommerceServer.Core.Runtime.Orders.OrderAddress sourceAddress, EmailParty destinationParty) { destinationParty.ExternalId = sourceAddress.OrderAddressId; destinationParty.Name = sourceAddress.Name; destinationParty.Email = sourceAddress.Email; destinationParty.FirstName = sourceAddress.FirstName; destinationParty.LastName = sourceAddress.LastName; destinationParty.Company = sourceAddress.Organization; destinationParty.Text = sourceAddress[CommerceServerStorefrontConstants.KnowWeaklyTypesProperties.EmailText] as string; this.TranslateToCustomAddressProperties(sourceAddress, destinationParty); }
/// <summary> /// Translates to commerce party. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected virtual void TranslateToCommerceParty(CommerceServer.Core.Runtime.Orders.OrderAddress sourceAddress, ConnectOrderModels.CommerceParty destinationParty) { destinationParty.ExternalId = sourceAddress.OrderAddressId; destinationParty.City = sourceAddress.City; destinationParty.Country = sourceAddress.CountryName; destinationParty.CountryCode = sourceAddress.CountryCode; destinationParty.PhoneNumber = sourceAddress.DaytimePhoneNumber; destinationParty.Email = sourceAddress.Email; destinationParty.FirstName = sourceAddress.FirstName; destinationParty.LastName = sourceAddress.LastName; destinationParty.Address1 = sourceAddress.Line1; destinationParty.Address2 = sourceAddress.Line2; destinationParty.ZipPostalCode = sourceAddress.PostalCode; destinationParty.State = sourceAddress.State; destinationParty.EveningPhoneNumber = sourceAddress.EveningPhoneNumber; destinationParty.FaxNumber = sourceAddress.FaxNumber; destinationParty.Name = sourceAddress.Name; destinationParty.Company = sourceAddress.Organization; destinationParty.RegionCode = sourceAddress.RegionCode; destinationParty.RegionName = sourceAddress.RegionName; this.TranslateToCustomAddressProperties(sourceAddress, destinationParty); }
/// <summary> /// Translates to custom address properties. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected virtual void TranslateToCustomAddressProperties([NotNull] CommerceServer.Core.Runtime.Orders.OrderAddress sourceAddress, [NotNull] ConnectOrderModels.CommerceParty destinationParty) { }
/// <summary> /// Translates to custom party. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected virtual void TranslateToCustomParty(CommerceServer.Core.Runtime.Orders.OrderAddress sourceAddress, Party destinationParty) { }
/// <summary> /// Translates the address. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected virtual void TranslateAddress(OrderAddress sourceAddress, EmailParty destinationParty) { TranslateOrderAddressToEntityRequest request = new TranslateOrderAddressToEntityRequest(sourceAddress, destinationParty); PipelineUtility.RunCommerceConnectPipeline <TranslateOrderAddressToEntityRequest, CommerceResult>(PipelineNames.TranslateOrderAddressToEntity, request); }
/// <summary> /// Translates the address. /// </summary> /// <param name="sourceAddress">The source address.</param> /// <param name="destinationParty">The destination party.</param> protected override void TranslateAddress(OrderAddress sourceAddress, Commerce.Connect.CommerceServer.Orders.Models.CommerceParty destinationParty) { TranslateOrderAddressToEntityRequest request = new TranslateOrderAddressToEntityRequest(sourceAddress, destinationParty); PipelineUtility.RunCommerceConnectPipeline <TranslateOrderAddressToEntityRequest, CommerceResult>(PipelineNames.TranslateOrderAddressToEntity, request); }