/// <summary> /// Allows you to populate the current ShippableItem object using a ShippableItemDTO instance /// </summary> /// <param name="dto">An instance of the ShippableItem from the REST API</param> public void FromDto(ShippableItemDTO dto) { ExtraShipFee = dto.ExtraShipFee; Height = dto.Height; IsNonShipping = dto.IsNonShipping; Length = dto.Length; ShippingSource = (ShippingMode)(int)dto.ShippingSource; ShippingSourceId = dto.ShippingSourceId ?? string.Empty; ShipSeparately = dto.ShipSeparately; Weight = dto.Weight; Width = dto.Width; }
public void FromDto(ShippableItemDTO dto) { this.ExtraShipFee = dto.ExtraShipFee; this.Height = dto.Height; this.IsNonShipping = dto.IsNonShipping; this.Length = dto.Length; this.ShippingScheduleId = dto.ShippingScheduleId; this.ShippingSource = (ShippingMode)((int)dto.ShippingSource); this.ShippingSourceId = dto.ShippingSourceId ?? string.Empty; this.ShipSeparately = dto.ShipSeparately; this.Weight = dto.Weight; this.Width = dto.Width; }
/// <summary> /// Allows you to convert the current ShippableItem object to the DTO equivalent for use with the REST API /// </summary> /// <returns>A new instance of ShippableItemDTO</returns> public ShippableItemDTO ToDto() { var dto = new ShippableItemDTO(); dto.ExtraShipFee = ExtraShipFee; dto.Height = Height; dto.IsNonShipping = IsNonShipping; dto.Length = Length; dto.ShippingSource = (ShippingModeDTO)(int)ShippingSource; dto.ShippingSourceId = ShippingSourceId; dto.ShipSeparately = ShipSeparately; dto.Weight = Weight; dto.Width = Width; return(dto); }
public ShippableItemDTO ToDto() { ShippableItemDTO dto = new ShippableItemDTO(); dto.ExtraShipFee = this.ExtraShipFee; dto.Height = this.Height; dto.IsNonShipping = this.IsNonShipping; dto.Length = this.Length; dto.ShippingScheduleId = this.ShippingScheduleId; dto.ShippingSource = (ShippingModeDTO)((int)this.ShippingSource); dto.ShippingSourceId = this.ShippingSourceId; dto.ShipSeparately = this.ShipSeparately; dto.Weight = this.Weight; dto.Width = this.Width; return(dto); }
public ProductDTO() { Bvin = string.Empty; Sku = string.Empty; ProductName = string.Empty; ProductTypeId = string.Empty; CustomProperties = new List <CustomPropertyDTO>(); ListPrice = 0m; SitePrice = 0m; SitePriceOverrideText = string.Empty; SiteCost = 0m; MetaKeywords = string.Empty; MetaDescription = string.Empty; MetaTitle = string.Empty; TaxExempt = false; TaxSchedule = -1; Status = ProductStatusDTO.Active; ImageFileSmall = string.Empty; ImageFileMedium = string.Empty; ImageFileSmallAlternateText = string.Empty; ImageFileMediumAlternateText = string.Empty; CreationDateUtc = DateTime.UtcNow; MinimumQty = 1; ShortDescription = string.Empty; LongDescription = string.Empty; ManufacturerId = string.Empty; VendorId = string.Empty; GiftWrapAllowed = false; Keywords = string.Empty; PreContentColumnId = string.Empty; PostContentColumnId = string.Empty; UrlSlug = string.Empty; GiftWrapPrice = 0m; ShippingDetails = new ShippableItemDTO(); Featured = false; AllowReviews = false; Tabs = new List <ProductDescriptionTabDTO>(); StoreId = 0; IsAvailableForSale = true; InventoryMode = ProductInventoryModeDTO.AlwayInStock; IsSearchable = true; }