public void FromDTO(OrderDTO dto) { if (dto == null) return; this.AffiliateID = dto.AffiliateID ?? string.Empty; this.BillingAddress.FromDto(dto.BillingAddress); this.bvin = dto.Bvin ?? string.Empty; this.Coupons.Clear(); if (dto.Coupons != null) { foreach (OrderCouponDTO c in dto.Coupons) { OrderCoupon cp = new OrderCoupon(); cp.FromDto(c); this.Coupons.Add(cp); } } this.CustomProperties.Clear(); if (dto.CustomProperties != null) { foreach (CustomPropertyDTO prop in dto.CustomProperties) { CustomProperty p = new CustomProperty(); p.FromDto(prop); this.CustomProperties.Add(p); } } this.FraudScore = dto.FraudScore; this.Id = dto.Id; this.Instructions = dto.Instructions ?? string.Empty; this.IsPlaced = dto.IsPlaced; this.Items.Clear(); if (dto.Items != null) { foreach (LineItemDTO li in dto.Items) { LineItem l = new LineItem(); l.FromDto(li); this.Items.Add(l); } } this.LastUpdatedUtc = dto.LastUpdatedUtc; this.Notes.Clear(); if (dto.Notes != null) { foreach (OrderNoteDTO n in dto.Notes) { OrderNote nn = new OrderNote(); nn.FromDto(n); this.Notes.Add(nn); } } this.OrderDiscountDetails.Clear(); if (dto.OrderDiscountDetails != null) { foreach (DiscountDetailDTO d in dto.OrderDiscountDetails) { Marketing.DiscountDetail m = new Marketing.DiscountDetail(); m.FromDto(d); this.OrderDiscountDetails.Add(m); } } this.OrderNumber = dto.OrderNumber ?? string.Empty; this.Packages.Clear(); if (dto.Packages != null) { foreach (OrderPackageDTO pak in dto.Packages) { OrderPackage pak2 = new OrderPackage(); pak2.FromDto(pak); this.Packages.Add(pak2); } } this.PaymentStatus = (OrderPaymentStatus)((int)dto.PaymentStatus); this.ShippingAddress.FromDto(dto.ShippingAddress); this.ShippingDiscountDetails.Clear(); if (dto.ShippingDiscountDetails != null) { foreach (DiscountDetailDTO sd in dto.ShippingDiscountDetails) { Marketing.DiscountDetail sdd = new Marketing.DiscountDetail(); sdd.FromDto(sd); this.ShippingDiscountDetails.Add(sdd); } } this.ShippingMethodDisplayName = dto.ShippingMethodDisplayName ?? string.Empty; this.ShippingMethodId = dto.ShippingMethodId ?? string.Empty; this.ShippingProviderId = dto.ShippingProviderId ?? string.Empty; this.ShippingProviderServiceCode = dto.ShippingProviderServiceCode ?? string.Empty; this.ShippingStatus = (OrderShippingStatus)((int)dto.ShippingStatus); this.StatusCode = dto.StatusCode ?? string.Empty; this.StatusName = dto.StatusName ?? string.Empty; this.StoreId = dto.StoreId; this.ThirdPartyOrderId = dto.ThirdPartyOrderId ?? string.Empty; this.TimeOfOrderUtc = dto.TimeOfOrderUtc; this.TotalHandling = dto.TotalHandling; this.TotalShippingBeforeDiscounts = dto.TotalShippingBeforeDiscounts; this.TotalTax = dto.TotalTax; this.TotalTax2 = dto.TotalTax2; this.UserEmail = dto.UserEmail ?? string.Empty; this.UserID = dto.UserID ?? string.Empty; }