コード例 #1
0
 private BaseCreditPlanBusinessLogicEntity MapCreditPlanLogicEntityFromLoanProduct(TakenLoan loanProduct)
 {
     return this.MapCreditPlanLogicEntityFromLoanProduct(
         loanProduct.MaturityInMonth,
         loanProduct.Amount,
         loanProduct.ProductLoan.Percentage,
         loanProduct.ProductLoan.Type);
 }
コード例 #2
0
 public ClientCreditModel(TakenLoan takenLoan)
 {
     Contract.Requires<NullReferenceException>(takenLoan.IsNotNull());
     this.CreditPlanName = takenLoan.ProductLoan.Name;
     this.ExpirationDate = takenLoan.TakeDate.AddMonths(takenLoan.MaturityInMonth);
     if (takenLoan.Payments.Any())
     {
         var nextPayment = takenLoan.Payments.OrderBy(x => x.Date).First(x => x.Date > DateTime.Today);
         this.NextPaymentDate = nextPayment.Date;
         this.NextPaymentAmout = nextPayment.Amount.ToGBString();
     }
     this.Description = takenLoan.ProductLoan.Description;
 }
コード例 #3
0
 private static void CheckTakenLoanStatus(TakenLoan takenLoan)
 {
     if (takenLoan.Payments.All(loanPayment => loanPayment.Status == LoanPaymentStatus.Paid || loanPayment.Status == LoanPaymentStatus.PaidWithDelay))
     {
         takenLoan.Status = TakenLoanStatus.Paid;
     }
 }
コード例 #4
0
 private void AddLoanPayments(TakenLoan takenLoan)
 {
     var payments = creditManager.GetMonthlyPayments(takenLoan);
     var date = DateTime.Now.Date.AddMonths(1);
     foreach (var payment in payments)
     {
         if (payment != 0)
         {
             takenLoan.Payments.Add(this.CreatePayment(payment, date));
         }
         date = date.AddMonths(1);
     }
 }
コード例 #5
0
 private static TakenLoan CreateTakenLoanForClient(LoanRequest loanRequest)
 {
     var takenLoan = new TakenLoan
                         {
                             Amount = loanRequest.Amount,
                             MaturityInMonth = loanRequest.Months,
                             ProductLoan = loanRequest.LoanProduct,
                             TakeDate = DateTime.UtcNow,
                             Payments = new Collection<LoanPayment>(),
                             Status = TakenLoanStatus.Active
                         };
     loanRequest.Client.TakenLoans.Add(takenLoan);
     return takenLoan;
 }
コード例 #6
0
 private void ProceedTakenLoans(TakenLoan takenLoans, DateTime date, Client client)
 {
     takenLoans.Payments.ForEach(x => this.ProceedPayment(x, date, client));
 }
コード例 #7
0
 private void ReCalcualteTakenLoanFine(TakenLoan takenLoan, DateTime date)
 {
     takenLoan.Payments.ForEach(x => this.ReCalculatePayment(x, date, takenLoan.ProductLoan));
 }
コード例 #8
0
 public IEnumerable<decimal> GetMonthlyPayments(TakenLoan takenLoan)
 {
     return this.GetMonthlyPayments(new Collection<TakenLoan> { takenLoan }).First().Value;
 }