コード例 #1
0
        public void Reject(Operator decisionBy)
        {
            if (Status != LoanApplicationStatus.New)
            {
                throw new ApplicationException("Cannot reject application that is already accepted or rejected");
            }

            Status   = LoanApplicationStatus.Rejected;
            Decision = new Decision(SysTime.Now(), decisionBy);
        }
コード例 #2
0
        public void Accept(Operator decisionBy)
        {
            if (Status != LoanApplicationStatus.New)
            {
                throw new ApplicationException("Cannot accept application that is already accepted or rejected");
            }

            if (Score == null)
            {
                throw new ApplicationException("Cannot accept application before scoring");
            }

            if (!decisionBy.CanAccept(this.Loan.LoanAmount))
            {
                throw new ApplicationException("Operator does not have required competence level to accept application");
            }

            Status   = LoanApplicationStatus.Accepted;
            Decision = new Decision(SysTime.Now(), decisionBy);
        }
コード例 #3
0
 public LoanApplication(string number, Customer customer, Property property, Loan loan, Operator registeredBy)
     : this(number, LoanApplicationStatus.New, customer, property, loan, null, new Registration(SysTime.Now(), registeredBy), null)
 {
 }
コード例 #4
0
ファイル: Loan.cs プロジェクト: jianba/NetCoreExamples
 public DateTime LastInstallmentsDate()
 {
     return(SysTime.Now().AddYears(LoanNumberOfYears));
 }