Ejemplo n.º 1
0
 public void FillBorrower(LoanPaymentModel borrower)
 {
     this.txtInterestDue.Text = borrower.InterestDue.ToString("N");
     this.txtPastDue.Text = borrower.PastDue.ToString("N");
     this.txtPrincipalDue.Text = borrower.PrincipalDue.ToString("N");
     this.txtTotalLoanBalance.Text = borrower.TotalAmountDue.ToString("N");
 }
Ejemplo n.º 2
0
        public async Task <ActionResult <PaymentTakenModel> > TakePayment(Guid id, LoanPaymentModel model)
        {
            //Convert that to the Domain Model's representation
            var command = model.ToCommand(id);
            //Execute Domain Model logic
            var receipt = await takePaymentCommandHandler.Handle(command);

            //Return an Acknowledgement to the client
            return(new PaymentTakenModel {
                TransactionId = receipt.TransactionId
            });
        }
Ejemplo n.º 3
0
 protected void Fill(LoanPaymentModel model, DateTime selectedDate)
 {
     var validDueDate = DateAdjustment.AdjustToNextWorkingDayIfInvalid(selectedDate);
     hiddenLoanID.Value = model.LoanID;
     decimal interest = 0;
     //loanbalance,loanreleasedate, agreementid,
     var query = from f in ObjectContext.FinancialAccounts
                       join a in ObjectContext.Agreements on f.AgreementId equals a.Id
                       join ai in ObjectContext.AgreementItems on f.AgreementId equals ai.AgreementId
                       where f.Id == model.LoanID && a.EndDate == null && ai.IsActive == true
                       select new
                       {
                           loanaccount = f.LoanAccount,
                           agreementitem = ai
                             };
     if (query.Count() != 0)
     {
         var loanAccount = query.FirstOrDefault().loanaccount;
         dtBill.MinDate = (DateTime)loanAccount.LoanReleaseDate;
         var agreementitem = query.FirstOrDefault().agreementitem;
         if (selectedDate > loanAccount.LoanReleaseDate)
         {
             interest += GenerateBillFacade.GenerateAndSaveInterest(loanAccount, agreementitem, GenerateBillFacade.ManualBillingDisplay, selectedDate, validDueDate, selectedDate);
             interest += GenerateBillFacade.GenerateInterestForLastMonth(selectedDate, loanAccount, agreementitem, GenerateBillFacade.ManualBillingDisplay);
         }
         txtInterestPayment.Text = interest.ToString("N");
         var balance = loanAccount.LoanBalance;
         txtTotalLoanBalance.Text = balance.ToString("N"); ;
         hiddenAgreementID.Value = agreementitem.AgreementId;
     }
 }