コード例 #1
0
        private decimal longTermReloanReleaseAmount()
        {
            LoanFactory factory = new LoanFactory(DatabaseFactory.Default);
            Loan        newLoan = factory.Clone(originalLoan);

            newLoan.InterestRate = originalLoan.InterestRate + 1;

            decimal newInterest  = LoanCalculator.InterestPaymentPart(originalLoan.MonthlyDue, originalLoan.Principal, originalLoan.InterestRate + 1, originalLoan.MonthlyDue);
            decimal newPrincipal = originalLoan.MonthlyDue - newInterest;

            return((newPrincipal * originalLoan.MonthsPaid) - originalLoan.ProcessingFee);
        }
コード例 #2
0
 private decimal interestAmount()
 {
     if (IsInterestPayment)
     {
         return(Amount);
     }
     if (Loan == null)
     {
         throw new InvalidOperationException("No loan found.");
     }
     return(LoanCalculator.InterestPaymentPart(Amount, loan));
 }