Exemple #1
0
        public void FromDto(OrderPackageDTO dto)
        {
            if (dto == null)
            {
                return;
            }

            if (dto.CustomProperties != null)
            {
                this.CustomProperties.Clear();
                foreach (CustomPropertyDTO prop in dto.CustomProperties)
                {
                    CustomProperty p = new CustomProperty();
                    p.FromDto(prop);
                    this.CustomProperties.Add(p);
                }
            }
            this.Description           = dto.Description ?? string.Empty;
            this.EstimatedShippingCost = dto.EstimatedShippingCost;
            this.HasShipped            = dto.HasShipped;
            this.Height = dto.Height;
            this.Id     = dto.Id;
            if (dto.Items != null)
            {
                this.Items.Clear();
                foreach (OrderPackageItemDTO item in dto.Items)
                {
                    OrderPackageItem pak = new OrderPackageItem();
                    pak.FromDto(item);
                    this.Items.Add(pak);
                }
            }
            this.LastUpdatedUtc              = dto.LastUpdatedUtc;
            this.Length                      = dto.Length;
            this.OrderId                     = dto.OrderId ?? string.Empty;
            this.ShipDateUtc                 = dto.ShipDateUtc;
            this.ShippingMethodId            = dto.ShippingMethodId ?? string.Empty;
            this.ShippingProviderId          = dto.ShippingProviderId ?? string.Empty;
            this.ShippingProviderServiceCode = dto.ShippingProviderServiceCode ?? string.Empty;
            this.SizeUnits                   = (MerchantTribe.Shipping.LengthType)((int)dto.SizeUnits);
            this.StoreId                     = dto.StoreId;
            this.TrackingNumber              = dto.TrackingNumber ?? string.Empty;
            this.Weight                      = dto.Weight;
            this.WeightUnits                 = (MerchantTribe.Shipping.WeightType)((int)dto.WeightUnits);
            this.Width = dto.Width;
        }
        public void FromDto(OrderPackageDTO dto)
        {
            if (dto == null) return;

            if (dto.CustomProperties != null)
            {
                this.CustomProperties.Clear();
                foreach (CustomPropertyDTO prop in dto.CustomProperties)
                {
                    CustomProperty p = new CustomProperty();
                    p.FromDto(prop);
                    this.CustomProperties.Add(p);
                }
            }
            this.Description = dto.Description ?? string.Empty;
            this.EstimatedShippingCost = dto.EstimatedShippingCost;
            this.HasShipped = dto.HasShipped;
            this.Height = dto.Height;
            this.Id = dto.Id;
            if (dto.Items != null)
            {
                this.Items.Clear();
                foreach (OrderPackageItemDTO item in dto.Items)
                {
                    OrderPackageItem pak = new OrderPackageItem();
                    pak.FromDto(item);
                    this.Items.Add(pak);
                }
            }
            this.LastUpdatedUtc = dto.LastUpdatedUtc;
            this.Length = dto.Length;
            this.OrderId = dto.OrderId ?? string.Empty;
            this.ShipDateUtc = dto.ShipDateUtc;
            this.ShippingMethodId = dto.ShippingMethodId ?? string.Empty;
            this.ShippingProviderId = dto.ShippingProviderId ?? string.Empty;
            this.ShippingProviderServiceCode = dto.ShippingProviderServiceCode ?? string.Empty;
            this.SizeUnits = (MerchantTribe.Shipping.LengthType)((int)dto.SizeUnits);
            this.StoreId = dto.StoreId;
            this.TrackingNumber = dto.TrackingNumber ?? string.Empty;
            this.Weight = dto.Weight;
            this.WeightUnits = (MerchantTribe.Shipping.WeightType)((int)dto.WeightUnits);
            this.Width = dto.Width;

        }