Example #1
0
        public static decimal CalcGiftFreight(int regionId, IList <ShoppingCartGiftInfo> lineGifts)
        {
            decimal     num  = default(decimal);
            IList <int> list = new List <int>();

            foreach (ShoppingCartGiftInfo lineGift in lineGifts)
            {
                if (!list.Contains(lineGift.ShippingTemplateId) && lineGift.PromoType == 0)
                {
                    list.Add(lineGift.ShippingTemplateId);
                }
            }
            for (int i = 0; i < list.Count(); i++)
            {
                int     num2 = 0;
                decimal num3 = default(decimal);
                decimal num4 = default(decimal);
                int     num5 = list[i];
                foreach (ShoppingCartGiftInfo lineGift2 in lineGifts)
                {
                    if (lineGift2.ShippingTemplateId == num5 && lineGift2.PromoType == 0)
                    {
                        num3 += lineGift2.Weight * (decimal)lineGift2.Quantity;
                        num2 += lineGift2.Quantity;
                        num4 += lineGift2.Volume * (decimal)lineGift2.Quantity;
                    }
                }
                num += ShoppingProcessor.CalcFreight_ShipppingTemplate(regionId, num5, num2, num3, num4, decimal.Zero);
            }
            return(num);
        }
Example #2
0
        public static decimal CalcSupplierFreight(int supplierId, int regionId, ShoppingCartInfo shoppingCart)
        {
            decimal     num  = default(decimal);
            IList <int> list = shoppingCart.ShippingTemplateIdList(supplierId);

            for (int i = 0; i < list.Count(); i++)
            {
                int     quantity           = 0;
                decimal weight             = default(decimal);
                decimal volume             = default(decimal);
                decimal amount             = default(decimal);
                int     shippingTemplateId = list[i];
                shoppingCart.TotalValuationData(shippingTemplateId, out quantity, out weight, out volume, out amount, supplierId);
                num += ShoppingProcessor.CalcFreight_ShipppingTemplate(regionId, shippingTemplateId, quantity, weight, volume, amount);
            }
            return(num);
        }
Example #3
0
        public static decimal CalcProductFreight(int regionId, int shippingTemplateId, decimal volume, decimal weight, int quantity = 1, decimal amount = default(decimal))
        {
            decimal num = default(decimal);

            return(ShoppingProcessor.CalcFreight_ShipppingTemplate(regionId, shippingTemplateId, quantity, weight * (decimal)quantity, volume * (decimal)quantity, amount * (decimal)quantity));
        }