示例#1
0
 /// <summary>
 /// The tax included in product price.
 /// </summary>
 /// <param name="extendedData">
 /// The extended data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not tax is included in the product price.
 /// </returns>
 public static bool TaxIncludedInProductPrice(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.TaxIncludedInProductPrice) &&
            extendedData.GetValue(Constants.ExtendedDataKeys.TaxIncludedInProductPrice).AsBool());
 }
示例#2
0
 /// <summary>
 /// Returns the "merchOnSale" value as a boolean
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not the item is on sale.
 /// </returns>
 public static bool GetOnSaleValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.OnSale).AsBool());
 }
示例#3
0
 /// <summary>
 /// True/false indicating whether or not the collection contains a ShipmentKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not the extended data collection contains a shipment key.
 /// </returns>
 public static bool ContainsShipmentKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.ShipmentKey));
 }
示例#4
0
 /// <summary>
 /// True/false indicating whether or not the collection contains a WarehouseCatalogKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not the extended data collection contains a warehouse key.
 /// </returns>
 public static bool ContainsWarehouseCatalogKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.WarehouseCatalogKey));
 }
示例#5
0
 /// <summary>
 /// returns the "merchWeight" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>The barcode</returns>
 public static string GetBarcodeValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.Barcode));
 }
示例#6
0
 /// <summary>
 /// Gets an <see cref="IAddress"/> from the <see cref="ExtendedDataCollection"/>
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <param name="addressType">
 /// The address Type.
 /// </param>
 /// <returns>
 /// The <see cref="IAddress"/>.
 /// </returns>
 public static IAddress GetAddress(this ExtendedDataCollection extendedData, AddressType addressType)
 {
     return(extendedData.GetAddress(addressType == AddressType.Shipping
                                        ? Constants.ExtendedDataKeys.ShippingDestinationAddress
                                        : Constants.ExtendedDataKeys.BillingAddress));
 }
示例#7
0
 /// <summary>
 /// Returns the VersionKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The version key.
 /// </returns>
 public static Guid GetVersionKey(this ExtendedDataCollection extendedData)
 {
     return(!extendedData.ContainsVersionKey() ?
            Guid.Empty :
            extendedData.GetValue(Constants.ExtendedDataKeys.VersionKey).AsGuid());
 }
示例#8
0
 /// <summary>
 /// returns the "merchLength" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>The length</returns>
 public static decimal GetLengthValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.Length).AsDecimal());
 }
示例#9
0
 /// <summary>
 /// Returns the ProductKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The product key.
 /// </returns>
 public static Guid GetProductKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.ProductKey).AsGuid());
 }
示例#10
0
 /// <summary>
 /// True/false indicating whether or not the collection contains a ProductKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended data.
 /// </param>
 /// <returns>
 ///  A value indicating whether or not the extended data collection contains a version key.
 /// </returns>
 public static bool ContainsVersionKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.VersionKey));
 }
示例#11
0
 /// <summary>
 /// True/false indicating whether or not the collection contains a ProductVariantKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not the extended data collection contains a product variant key.
 /// </returns>
 public static bool ContainsProductVariantKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.ProductVariantKey));
 }
示例#12
0
 /// <summary>
 /// True/false indicating whether or not this extended data collection contains information
 /// which could define a <see cref="IProductVariant"/>
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 public static bool DefinesProductVariant(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsProductVariantKey() && extendedData.ContainsProductKey());
 }
示例#13
0
 /// <summary>
 /// The contains any.
 /// </summary>
 /// <param name="extendedData">
 /// The extended data.
 /// </param>
 /// <param name="keys">
 /// The keys.
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 public static bool ContainsAny(this ExtendedDataCollection extendedData, IEnumerable <string> keys)
 {
     return(extendedData.Keys.ToArray().Any(keys.Contains));
 }
示例#14
0
 /// <summary>
 /// Returns the "merchSalePrice" value
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The sales price
 /// </returns>
 public static decimal GetSalePriceValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.SalePrice).AsDecimal());
 }
示例#15
0
 /// <summary>
 /// Returns the "merchTrackInventory" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>A value indicating whether or not the line item (product) should be included in inventory operations</returns>
 public static bool GetTrackInventoryValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.TrackInventory).AsBool());
 }
示例#16
0
 /// <summary>
 /// Returns the "merchManufacturerModelNumber" value
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The manufacturers model number
 /// </returns>
 public static string GetManufacturerModelNumberValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.ManufacturerModelNumber));
 }
示例#17
0
 /// <summary>
 /// Returns the "merchOutOfStockPurchase" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>A value indicating whether or not the item can be purchased even if it's out of stock</returns>
 public static bool GetOutOfStockPurchaseValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.OutOfStockPurchase).AsBool());
 }
示例#18
0
 /// <summary>
 /// True/false indicating whether or not this extended data collection contains a child serialized extended data collection
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// A value indicating whether or not this extended data collection contains a child serialized extended data collection
 /// </returns>
 public static bool ContainsExtendedDataSerialization(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsKey(Constants.ExtendedDataKeys.ExtendedData));
 }
示例#19
0
 /// <summary>
 /// The add extended data collection.
 /// </summary>
 /// <param name="extendedData">
 /// The extended data.
 /// </param>
 /// <param name="extendedDataToSerialize">
 /// The extended data to serialize.
 /// </param>
 public static void AddExtendedDataCollection(this ExtendedDataCollection extendedData, ExtendedDataCollection extendedDataToSerialize)
 {
     extendedData.SetValue(Constants.ExtendedDataKeys.ExtendedData, extendedDataToSerialize.SerializeToXml());
 }
示例#20
0
 /// <summary>
 /// Adds an <see cref="IAddress"/> to extended data.  This is intended for shipment addresses
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <param name="address">
 /// The address.
 /// </param>
 /// <param name="addressType">
 /// The Origin or Destination addresses
 /// </param>
 public static void AddAddress(this ExtendedDataCollection extendedData, IAddress address, AddressType addressType)
 {
     extendedData.AddAddress(
         address,
         addressType == AddressType.Shipping ? Constants.ExtendedDataKeys.ShippingDestinationAddress : Constants.ExtendedDataKeys.BillingAddress);
 }
示例#21
0
 /// <summary>
 /// Returns the "merchDownload" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>A value indicating whether or not the item is downloadable</returns>
 public static bool GetDownloadValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.Download).AsBool());
 }
示例#22
0
 /// <summary>
 /// Gets a <see cref="ExtendedDataCollection"/> from the <see cref="ExtendedDataCollection"/>
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The <see cref="ExtendedDataCollection"/>.
 /// </returns>
 public static ExtendedDataCollection GetExtendedDataCollection(this ExtendedDataCollection extendedData)
 {
     return(extendedData.ContainsExtendedDataSerialization()
                ? new ExtendedDataCollection(extendedData.GetValue(Constants.ExtendedDataKeys.ExtendedData))
                : null);
 }
示例#23
0
 /// <summary>
 /// Returns the "merchTrackInventory" value
 /// </summary>
 /// <param name="extendedData">The <see cref="ExtendedDataCollection"/></param>
 /// <returns>The Umbraco media Id</returns>
 public static int GetDownloadMediaIdValue(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.DownloadMediaId).AsInt());
 }
示例#24
0
 /// <summary>
 /// Returns the merchShipMethodKey value as a GUID
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The GUID based 'Key' of the <see cref="IShipMethod"/>
 /// </returns>
 public static Guid GetShipMethodKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.ShipMethodKey).AsGuid());
 }
示例#25
0
        /// <summary>
        /// Returns the "merchPrice" value
        /// </summary>
        /// <param name="extendedData">
        /// The extended Data.
        /// </param>
        /// <returns>
        /// The price.
        /// </returns>
        public static decimal GetPriceValue(this ExtendedDataCollection extendedData)
        {
            decimal converted = decimal.TryParse(extendedData.GetValue(Constants.ExtendedDataKeys.Price), System.Globalization.NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out converted) ? converted : 0;

            return(converted);
        }
示例#26
0
 /// <summary>
 /// Return the WarehouseCatalogKey
 /// </summary>
 /// <param name="extendedData">
 /// The extended Data.
 /// </param>
 /// <returns>
 /// The GUID warehouse catalog key.
 /// </returns>
 public static Guid GetWarehouseCatalogKey(this ExtendedDataCollection extendedData)
 {
     return(extendedData.GetValue(Constants.ExtendedDataKeys.WarehouseCatalogKey).AsGuid());
 }
示例#27
0
 /// <summary>
 /// The get allows validation value.
 /// </summary>
 /// <param name="extendedData">
 /// The extended data.
 /// </param>
 /// <returns>
 /// The <see cref="bool"/>.
 /// </returns>
 internal static bool GetAllowsValidationValue(this ExtendedDataCollection extendedData)
 {
     return(!extendedData.ContainsKey(Constants.ExtendedDataKeys.LineItemAllowsValidation) ||
            extendedData.GetValue(Constants.ExtendedDataKeys.LineItemAllowsValidation).AsBool());
 }