Пример #1
0
 /// <summary>
 /// Shows selected account details on mainform textboxes.
 /// </summary>
 /// <param name="entity"></param>
 private void ShowAccountDetails(IEntity entity)
 {
     if (entity is IAccountEntity)
     {
         IAccountEntity accountEntity = entity as IAccountEntity;
         this.accountNumberBox.Text  = accountEntity.GetEntityNumber().ToString();
         this.currentBalanceBox.Text = accountEntity.GetCurrentAmount().ToString();
     }
     if (entity is IInterestEntity)
     {
         IInterestEntity interestEntity = entity as IInterestEntity;
         this.interestRateBox.Text        = interestEntity.GetInterestRate().ToString();
         this.totalInterestAmountBox.Text = interestEntity.GetInterestValue().ToString();
     }
     if (entity is ILoanEntity)
     {
         LoanAccount loanEntity = entity as LoanAccount;
         this.label7.Text         = "Total Loan Amount";
         this.totalAmountBox.Text = loanEntity.GetLoanAmount().ToString();
     }
 }