Example #1
0
        /// <summary>
        /// Bulks the quantity index for row quantity.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <param name="quantity">The quantity.</param>
        /// <returns></returns>
        public int BulkQuantityIndexForRowQuantity(UPSERow row, double quantity)
        {
            if (quantity < 0)
            {
                string quantityString = row.ValueForFunctionName("Quantity");
                if (!string.IsNullOrEmpty(quantityString))
                {
                    quantity = Convert.ToDouble(quantityString, System.Globalization.CultureInfo.InvariantCulture);
                }
            }

            UPSEPricingBulkVolume bulkVolume = this.BulkVolumeForRow(row);

            if (bulkVolume != null)
            {
                return(bulkVolume.IndexForQuantity(quantity));
            }

            return(-1);
        }