public static PaymentPlan ConvertToPaymentPlan(this OrderGroup orderGroup, PaymentPlan paymentPlan) { if (!string.IsNullOrEmpty(orderGroup.AddressId)) { paymentPlan.AddressId = orderGroup.AddressId; } if (orderGroup.AffiliateId != Guid.Empty) { paymentPlan.AffiliateId = orderGroup.AffiliateId; } if (!string.IsNullOrEmpty(orderGroup.BillingCurrency)) { paymentPlan.BillingCurrency = orderGroup.BillingCurrency; } if (!string.IsNullOrEmpty(orderGroup.CustomerName)) { paymentPlan.CustomerName = orderGroup.CustomerName; } if (orderGroup.HandlingTotal >= 0) { paymentPlan.HandlingTotal = orderGroup.HandlingTotal; } if (orderGroup.InstanceId != Guid.Empty) { paymentPlan.InstanceId = orderGroup.InstanceId; } if (orderGroup.MarketId != null) { paymentPlan.MarketId = orderGroup.MarketId; } if (!string.IsNullOrEmpty(orderGroup.Owner)) { paymentPlan.Owner = orderGroup.Owner; } if (!string.IsNullOrEmpty(orderGroup.OwnerOrg)) { paymentPlan.OwnerOrg = orderGroup.OwnerOrg; } if (!string.IsNullOrEmpty(orderGroup.ProviderId)) { paymentPlan.ProviderId = orderGroup.ProviderId; } if (orderGroup.ShippingTotal >= 0) { paymentPlan.ShippingTotal = orderGroup.ShippingTotal; } if (!string.IsNullOrEmpty(orderGroup.Status)) { paymentPlan.Status = orderGroup.Status; } if (orderGroup.SubTotal >= 0) { paymentPlan.SubTotal = orderGroup.SubTotal; } if (orderGroup.TaxTotal >= 0) { paymentPlan.TaxTotal = orderGroup.TaxTotal; } if (orderGroup.Total >= 0) { paymentPlan.Total = orderGroup.Total; } orderGroup.MapPropertiesToModel(paymentPlan); MapOrderAddresses(orderGroup, paymentPlan); MapOrderNotes(orderGroup, paymentPlan); MapOrderForms(orderGroup, paymentPlan); return(paymentPlan); }
public static Cart ConvertToCart(this OrderGroup orderGroup, Cart cart) { if (!string.IsNullOrEmpty(orderGroup.AddressId)) { cart.AddressId = orderGroup.AddressId; } if (orderGroup.AffiliateId != Guid.Empty) { cart.AffiliateId = orderGroup.AffiliateId; } if (!string.IsNullOrEmpty(orderGroup.BillingCurrency)) { cart.BillingCurrency = orderGroup.BillingCurrency; } if (!string.IsNullOrEmpty(orderGroup.CustomerName)) { cart.CustomerName = orderGroup.CustomerName; } if (orderGroup.HandlingTotal >= 0) { cart.HandlingTotal = orderGroup.HandlingTotal; } if (orderGroup.InstanceId != Guid.Empty) { cart.InstanceId = orderGroup.InstanceId; } if (orderGroup.MarketId != null) { cart.MarketId = orderGroup.MarketId; } if (!string.IsNullOrEmpty(orderGroup.Owner)) { cart.Owner = orderGroup.Owner; } if (!string.IsNullOrEmpty(orderGroup.OwnerOrg)) { cart.OwnerOrg = orderGroup.OwnerOrg; } if (!string.IsNullOrEmpty(orderGroup.ProviderId)) { cart.ProviderId = orderGroup.ProviderId; } if (orderGroup.ShippingTotal >= 0) { cart.ShippingTotal = orderGroup.ShippingTotal; } if (!string.IsNullOrEmpty(orderGroup.Status)) { cart.Status = orderGroup.Status; } if (orderGroup.SubTotal >= 0) { cart.SubTotal = orderGroup.SubTotal; } if (orderGroup.TaxTotal >= 0) { cart.TaxTotal = orderGroup.TaxTotal; } if (orderGroup.Total >= 0) { cart.Total = orderGroup.Total; } orderGroup.MapPropertiesToModel(cart); MapOrderAddresses(orderGroup, cart); MapOrderNotes(orderGroup, cart); MapOrderForms(orderGroup, cart); return(cart); }