示例#1
0
        double IParcelRules.OverweightChargeRule(ShippingRate shippingRate)
        {
            if (_weight > shippingRate.WeightLimitKg)
            {
                return((_weight - shippingRate.WeightLimitKg) * shippingRate.OverweightChargePerKg);
            }

            return(0);
        }
示例#2
0
        private double CalculateOverweightCharge(ShippingRate shippingRate)
        {
            if (WeightKg > shippingRate.WeightLimitKg)
            {
                return((WeightKg - shippingRate.WeightLimitKg) * shippingRate.OverweightChargePerKg);
            }

            return(0);
        }