use of org.mifos.dto.screen.LoanAccountDetailDto in project head by mifos.
the class NotesAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
clearActionForm(form);
NotesActionForm notesActionForm = (NotesActionForm) form;
Integer accountId = Integer.valueOf(notesActionForm.getAccountId());
AccountBO account = new AccountBusinessService().getAccount(accountId);
if (account.isLoanAccount() || account.isGroupLoanAccount()) {
LoanAccountDetailDto loanAccountDto = this.loanAccountServiceFacade.retrieveLoanAccountNotes(accountId.longValue());
if (account.isLoanAccount()) {
notesActionForm.setAccountTypeId(AccountTypes.LOAN_ACCOUNT.getValue().toString());
} else {
notesActionForm.setAccountTypeId(AccountTypes.GROUP_LOAN_ACCOUNT.getValue().toString());
}
notesActionForm.setGlobalAccountNum(loanAccountDto.getGlobalAccountNum());
notesActionForm.setPrdOfferingName(loanAccountDto.getProductDetails().getPrdOfferingName());
} else if (account.isSavingsAccount()) {
SavingsAccountDetailDto savingsAccountDto = this.savingsServiceFacade.retrieveSavingsAccountNotes(accountId.longValue());
notesActionForm.setPrdOfferingName(savingsAccountDto.getProductDetails().getProductDetails().getName());
notesActionForm.setAccountTypeId(AccountTypes.SAVINGS_ACCOUNT.getValue().toString());
notesActionForm.setGlobalAccountNum(savingsAccountDto.getGlobalAccountNum());
}
return mapping.findForward(ActionForwards.load_success.toString());
}
Aggregations