private FinancialAccountRole CreateFinancialAccountRole(FinancialAccount financialAccount, PartyRole role) { FinancialAccountRole financialAccountRole = new FinancialAccountRole(); financialAccountRole.FinancialAccount = financialAccount; financialAccountRole.PartyRole = role; return financialAccountRole; }
public PaidOffLoansModel(FinancialAccountRole far) { var partyRole = ObjectContext.PartyRoles.SingleOrDefault(entity => entity.RoleTypeId == RoleType.OwnerFinancialType.Id && entity.Id == far.PartyRoleId && entity.EndDate == null); var agreementItem = far.FinancialAccount.Agreement.AgreementItems.SingleOrDefault(entity => entity.AgreementId == far.FinancialAccount.AgreementId && entity.IsActive); this.Name = Person.GetPersonFullName(partyRole.Party); this.LoanType = far.FinancialAccount.FinancialAccountProducts.SingleOrDefault(entity => entity.EndDate == null).FinancialProduct.Name; this.LoanAmount = far.FinancialAccount.LoanAccount.LoanAmount; this.InterestRate = agreementItem.InterestRate.ToString() + "%"; this.LoanTerm = agreementItem.LoanTermLength + " " + agreementItem.LoanTermUom; this.DatePaidOff = far.FinancialAccount.LoanAccount.CurrentStatus.TransitionDateTime; this._DatePaidOff = this.DatePaidOff.ToString("MMMM dd, yyyy"); }