Search in sources :

Example 1 with ContactSearch

use of com.autentia.tnt.dao.search.ContactSearch in project TNTConcept by autentia.

the class OfferBean method getContactsBySelectedOrganization.

/**
 * Selected organization *
 */
public List<SelectItem> getContactsBySelectedOrganization() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ContactSearch cs = new ContactSearch();
    cs.setOrganization(getOrganization());
    List<Contact> refs = ContactManager.getDefault().getAllEntities(cs, new SortCriteria("name"));
    for (Contact ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    // AƱadiendo el campo vacio
    ret.add(0, new SelectItem(""));
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) ContactSearch(com.autentia.tnt.dao.search.ContactSearch) Contact(com.autentia.tnt.businessobject.Contact)

Example 2 with ContactSearch

use of com.autentia.tnt.dao.search.ContactSearch in project TNTConcept by autentia.

the class BillBean method getContactsBySelectedOrganization.

public List<SelectItem> getContactsBySelectedOrganization() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ContactSearch cs = new ContactSearch();
    cs.setOrganization(getSelectedOrganization());
    List<Contact> refs = ContactManager.getDefault().getAllEntities(cs, new SortCriteria("name"));
    for (Contact ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    // AƱadiendo el campo vacio
    ret.add(0, new SelectItem(""));
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) ContactSearch(com.autentia.tnt.dao.search.ContactSearch)

Aggregations

SortCriteria (com.autentia.tnt.dao.SortCriteria)2 ContactSearch (com.autentia.tnt.dao.search.ContactSearch)2 ArrayList (java.util.ArrayList)2 SelectItem (javax.faces.model.SelectItem)2 Contact (com.autentia.tnt.businessobject.Contact)1