Search in sources :

Example 1 with SearchDetailsDto

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);
}
Also used : SearchDetailsDto(org.mifos.dto.screen.SearchDetailsDto) CustomerSearchDto(org.mifos.dto.domain.CustomerSearchDto) CustomerSearchResultDto(org.mifos.dto.domain.CustomerSearchResultDto) CustomerSearchResultsDto(org.mifos.dto.screen.CustomerSearchResultsDto)

Example 2 with SearchDetailsDto

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);
}
Also used : SearchDetailsDto(org.mifos.dto.screen.SearchDetailsDto) CustomerSearchDto(org.mifos.dto.domain.CustomerSearchDto) CustomerSearchResultDto(org.mifos.dto.domain.CustomerSearchResultDto) CustomerSearchResultsDto(org.mifos.dto.screen.CustomerSearchResultsDto)

Example 3 with SearchDetailsDto

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);
}
Also used : SearchDetailsDto(org.mifos.dto.screen.SearchDetailsDto) CustomerSearchDto(org.mifos.dto.domain.CustomerSearchDto) CustomerSearchResultDto(org.mifos.dto.domain.CustomerSearchResultDto) CustomerSearchResultsDto(org.mifos.dto.screen.CustomerSearchResultsDto)

Example 4 with SearchDetailsDto

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;
}
Also used : SearchDetailsDto(org.mifos.dto.screen.SearchDetailsDto) CustomerNoteDto(org.mifos.dto.domain.CustomerNoteDto) ArrayList(java.util.ArrayList) AccountNotesEntity(org.mifos.accounts.business.AccountNotesEntity) NotesSearchResultsDto(org.mifos.dto.screen.NotesSearchResultsDto) Criteria(org.hibernate.Criteria) Session(org.hibernate.Session)

Example 5 with SearchDetailsDto

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);
}
Also used : SearchDetailsDto(org.mifos.dto.screen.SearchDetailsDto) CustomerSearchDto(org.mifos.dto.domain.CustomerSearchDto) CustomerSearchResultDto(org.mifos.dto.domain.CustomerSearchResultDto) CustomerSearchResultsDto(org.mifos.dto.screen.CustomerSearchResultsDto)

Aggregations

SearchDetailsDto (org.mifos.dto.screen.SearchDetailsDto)5 CustomerSearchDto (org.mifos.dto.domain.CustomerSearchDto)4 CustomerSearchResultDto (org.mifos.dto.domain.CustomerSearchResultDto)4 CustomerSearchResultsDto (org.mifos.dto.screen.CustomerSearchResultsDto)4 ArrayList (java.util.ArrayList)1 Criteria (org.hibernate.Criteria)1 Session (org.hibernate.Session)1 AccountNotesEntity (org.mifos.accounts.business.AccountNotesEntity)1 CustomerNoteDto (org.mifos.dto.domain.CustomerNoteDto)1 NotesSearchResultsDto (org.mifos.dto.screen.NotesSearchResultsDto)1