コード例 #1
0
        public void Withdrawl(decimal amountToWithdrawl)
        {
            if (amountToWithdrawl < 0)
            {
                throw new NoNegativeTransactionException();
            }
            if (amountToWithdrawl > _balance)
            {
                throw new OverdraftException();
            }
            _balance -= amountToWithdrawl;

            // notify the feds
            _fedNotifier.NotifyOfWithdrawl(this, amountToWithdrawl);
        }