use of org.mifos.dto.screen.SearchDetailsDto in project head by mifos.
the class LoanAccountController method searchCustomers.
public CustomerSearchResultsDto searchCustomers(CustomerSearchFormBean formBean, boolean isNewGLIMCreation) {
// Search result cap. This is needed until ajax search is implemented.
Integer searchCap = 1000;
CustomerSearchDto customerSearchDto = new CustomerSearchDto(formBean.getSearchString(), Integer.valueOf(1), searchCap);
List<CustomerSearchResultDto> pagedDetails = this.loanAccountServiceFacade.retrieveCustomersThatQualifyForLoans(customerSearchDto, isNewGLIMCreation);
//int firstResult = formBean.getPage() * formBean.getPageSize() - (formBean.getPageSize()-1);
// FIXME selected pageNumber and pageSize info should be passed in on bean.
SearchDetailsDto searchDetails = new SearchDetailsDto(pagedDetails.size(), 1, 1, searchCap);
return new CustomerSearchResultsDto(searchDetails, pagedDetails);
}
use of org.mifos.dto.screen.SearchDetailsDto in project head by mifos.
the class LoanAccountController method searchPossibleGuarantors.
public CustomerSearchResultsDto searchPossibleGuarantors(CustomerSearchFormBean formBean, boolean isNewGLIMCreation, Integer clientId, Integer loanId) {
//As above, same issues occur (@searchCustomers)
Integer searchCap = 1000;
CustomerSearchDto customerSearchDto = new CustomerSearchDto(formBean.getSearchString(), Integer.valueOf(1), searchCap);
List<CustomerSearchResultDto> pagedDetails = this.loanAccountServiceFacade.retrievePossibleGuarantors(customerSearchDto, isNewGLIMCreation, clientId, loanId);
SearchDetailsDto searchDetails = new SearchDetailsDto(pagedDetails.size(), 1, 1, searchCap);
return new CustomerSearchResultsDto(searchDetails, pagedDetails);
}
use of org.mifos.dto.screen.SearchDetailsDto in project head by mifos.
the class CreateSavingsAccountController method searchCustomers.
public CustomerSearchResultsDto searchCustomers(CreateSavingsAccountFormBean formBean) {
// Search result cap. This is needed until ajax search is implemented.
Integer searchCap = 1000;
// FIXME - keithw - selected pageNumber and pageSize info should be passed in on bean.
CustomerSearchDto customerSearchDto = new CustomerSearchDto(formBean.getSearchString(), Integer.valueOf(1), searchCap);
List<CustomerSearchResultDto> pagedDetails = this.savingsServiceFacade.retrieveCustomerThatQualifyForSavings(customerSearchDto);
SearchDetailsDto searchDetails = new SearchDetailsDto(pagedDetails.size(), 1, 1, searchCap);
return new CustomerSearchResultsDto(searchDetails, pagedDetails);
}
use of org.mifos.dto.screen.SearchDetailsDto in project head by mifos.
the class SavingsDaoHibernate method searchNotes.
@SuppressWarnings("unchecked")
@Override
public NotesSearchResultsDto searchNotes(NoteSearchDto noteSearch) {
Session session = StaticHibernateUtil.getSessionTL();
Criteria criteriaQuery = session.createCriteria(AccountNotesEntity.class);
criteriaQuery.add(Restrictions.eq("account.accountId", noteSearch.getAccountId()));
criteriaQuery.addOrder(Order.desc("commentId"));
Integer totalNumberOfSavingsNotes = 10;
int firstResult = (noteSearch.getPage() * noteSearch.getPageSize()) - noteSearch.getPageSize();
criteriaQuery.setFirstResult(firstResult);
criteriaQuery.setMaxResults(noteSearch.getPageSize());
List<AccountNotesEntity> pagedResults = criteriaQuery.list();
List<CustomerNoteDto> pageDtoResults = new ArrayList<CustomerNoteDto>();
for (AccountNotesEntity note : pagedResults) {
pageDtoResults.add(new CustomerNoteDto(note.getCommentDate(), note.getComment(), note.getPersonnelName()));
}
SearchDetailsDto searchDetails = new SearchDetailsDto(totalNumberOfSavingsNotes.intValue(), firstResult, noteSearch.getPage(), noteSearch.getPageSize());
NotesSearchResultsDto resultsDto = new NotesSearchResultsDto(searchDetails, pageDtoResults);
return resultsDto;
}
use of org.mifos.dto.screen.SearchDetailsDto in project head by mifos.
the class FundTransferController method searchCustomers.
// All methods are called by Spring Webflow
public CustomerSearchResultsDto searchCustomers(CustomerSearchFormBean formBean) {
Integer searchCap = 1000;
CustomerSearchDto customerSearchDto = new CustomerSearchDto(formBean.getSearchString(), Integer.valueOf(1), searchCap);
List<CustomerSearchResultDto> pagedDetails = this.savingsServiceFacade.retrieveCustomersThatQualifyForTransfer(customerSearchDto);
SearchDetailsDto searchDetails = new SearchDetailsDto(pagedDetails.size(), 1, 1, searchCap);
return new CustomerSearchResultsDto(searchDetails, pagedDetails);
}
Aggregations