コード例 #1
0
        public decimal getTotalSavings()
        {
            decimal totalSavings = 0;
            int     amount       = _count;

            while (amount > 0)
            {
                if (_isOnPromotion && _promotionInfo.isMetPromoRequirements(amount))
                {
                    totalSavings += _promotionInfo.getSavings();
                    amount       -= _promotionInfo.getQuantityToGetPromoPrice();
                }
                else
                {
                    break;
                }
            }
            return(totalSavings);
        }