private void ImportSingleOrder(OrderSnapshotDTO snap) { Api oldProxy = GetOldStoreBV6Proxy(); ApiResponse <OrderDTO> response = oldProxy.OrdersFind(snap.bvin); ImportSingleOrder(snap); }
/// <summary> /// Allows you to convert the current order snapshot object to the DTO equivalent for use with the REST API /// </summary> /// <returns>A new instance of OrderSnapshotDTO</returns> public OrderSnapshotDTO ToDto() { var dto = new OrderSnapshotDTO(); dto.AffiliateID = AffiliateID; dto.BillingAddress = BillingAddress.ToDto(); dto.bvin = bvin ?? string.Empty; dto.CustomProperties = new List <CustomPropertyDTO>(); foreach (var prop in CustomProperties) { dto.CustomProperties.Add(prop.ToDto()); } dto.FraudScore = FraudScore; dto.Id = Id; dto.Instructions = Instructions ?? string.Empty; dto.IsPlaced = IsPlaced; dto.LastUpdatedUtc = LastUpdatedUtc; dto.OrderNumber = OrderNumber ?? string.Empty; dto.PaymentStatus = (OrderPaymentStatusDTO)(int)PaymentStatus; dto.ShippingAddress = ShippingAddress.ToDto(); dto.ShippingMethodDisplayName = ShippingMethodDisplayName ?? string.Empty; dto.ShippingMethodId = ShippingMethodId ?? string.Empty; dto.ShippingProviderId = ShippingProviderId ?? string.Empty; dto.ShippingProviderServiceCode = ShippingProviderServiceCode ?? string.Empty; dto.ShippingStatus = (OrderShippingStatusDTO)(int)ShippingStatus; dto.StatusCode = StatusCode ?? string.Empty; dto.StatusName = StatusName ?? string.Empty; dto.StoreId = StoreId; dto.ThirdPartyOrderId = ThirdPartyOrderId ?? string.Empty; dto.TimeOfOrderUtc = TimeOfOrderUtc; dto.TotalGrand = TotalGrand; dto.TotalHandling = TotalHandling; dto.TotalOrderBeforeDiscounts = TotalOrderBeforeDiscounts; dto.TotalOrderDiscounts = TotalOrderDiscounts; dto.TotalShippingBeforeDiscounts = TotalShippingBeforeDiscounts; dto.TotalShippingDiscounts = TotalShippingDiscounts; dto.ItemsTax = ItemsTax; dto.ShippingTax = ShippingTax; dto.TotalTax = TotalTax; dto.UserEmail = UserEmail ?? string.Empty; dto.UserID = UserID ?? string.Empty; return(dto); }
// DTO public OrderSnapshotDTO ToDto() { OrderSnapshotDTO dto = new OrderSnapshotDTO(); dto.AffiliateID = this.AffiliateID ?? string.Empty; dto.BillingAddress = this.BillingAddress.ToDto(); dto.bvin = this.bvin ?? string.Empty; dto.CustomProperties = new List <CustomPropertyDTO>(); foreach (CustomProperty prop in this.CustomProperties) { dto.CustomProperties.Add(prop.ToDto()); } dto.FraudScore = this.FraudScore; dto.Id = this.Id; dto.Instructions = this.Instructions ?? string.Empty; dto.IsPlaced = this.IsPlaced; dto.LastUpdatedUtc = this.LastUpdatedUtc; dto.OrderNumber = this.OrderNumber ?? string.Empty; dto.PaymentStatus = (OrderPaymentStatusDTO)((int)this.PaymentStatus); dto.ShippingAddress = this.ShippingAddress.ToDto(); dto.ShippingMethodDisplayName = this.ShippingMethodDisplayName ?? string.Empty; dto.ShippingMethodId = this.ShippingMethodId ?? string.Empty; dto.ShippingProviderId = this.ShippingProviderId ?? string.Empty; dto.ShippingProviderServiceCode = this.ShippingProviderServiceCode ?? string.Empty; dto.ShippingStatus = (OrderShippingStatusDTO)((int)this.ShippingStatus); dto.StatusCode = this.StatusCode ?? string.Empty; dto.StatusName = this.StatusName ?? string.Empty; dto.StoreId = this.StoreId; dto.ThirdPartyOrderId = this.ThirdPartyOrderId ?? string.Empty; dto.TimeOfOrderUtc = this.TimeOfOrderUtc; dto.TotalGrand = this.TotalGrand; dto.TotalHandling = this.TotalHandling; dto.TotalOrderBeforeDiscounts = this.TotalOrderBeforeDiscounts; dto.TotalOrderDiscounts = this.TotalOrderDiscounts; dto.TotalShippingBeforeDiscounts = this.TotalShippingBeforeDiscounts; dto.TotalShippingDiscounts = this.TotalShippingDiscounts; dto.TotalTax = this.TotalTax; dto.TotalTax2 = this.TotalTax2; dto.UserEmail = this.UserEmail ?? string.Empty; dto.UserID = this.UserID ?? string.Empty; return(dto); }