Search in sources :

Example 86 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class OfferBean method getCostss.

/**
 * Get the list of all costss
 *
 * @return the list of all costss
 */
public List<SelectItem> getCostss() {
    List<OfferCost> refs = OfferCostManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    for (OfferCost ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) OfferCost(com.autentia.tnt.businessobject.OfferCost) ArrayList(java.util.ArrayList)

Example 87 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class OrganizationBean method create.

/**
 * Go to create page
 * @return forward to CREATE page
 */
public String create() {
    organization = new Organization();
    // se inserta el departamento 'Indefinido' en caso de existir
    final DepartmentSearch departmentSearch = new DepartmentSearch();
    departmentSearch.setName("Indefinido");
    List<Department> departments = DepartmentManager.getDefault().getAllEntities(departmentSearch, new SortCriteria("name", true));
    Set<Department> departmentsSet = new HashSet<Department>();
    for (Department department : departments) {
        departmentsSet.add(department);
    }
    organization.setDepartments(departmentsSet);
    return NavigationResults.CREATE;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) DepartmentSearch(com.autentia.tnt.dao.search.DepartmentSearch) HashSet(java.util.HashSet)

Example 88 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class OrganizationBean method getTypes.

// Getters to list possible values of related entities
/**
 * Get the list of all types
 * @return the list of all types
 */
public List<SelectItem> getTypes() {
    List<OrganizationType> refs = OrganizationTypeManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    for (OrganizationType ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 89 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class OrganizationBean method getOrganizationDocCategories.

/**
 * Get the list of all countries
 * @return a list with all countries
 */
public List<SelectItem> getOrganizationDocCategories() {
    List<OrganizationDocCategory> refs = OrganizationDocCategoryManager.getDefault().getAllEntities(new SortCriteria("id"));
    ArrayList<SelectItem> ret = new ArrayList<>();
    for (OrganizationDocCategory ref : refs) {
        ret.add(new SelectItem(ref, ref.getCode() + " - " + ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 90 with SortCriteria

use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.

the class OrganizationBean method getCountries.

/**
 * Get the list of all countries
 * @return a list with all countries
 */
public List<SelectItem> getCountries() {
    List<Country> refs = CountryManager.getDefault().getAllEntities(new SortCriteria("id"));
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    for (Country ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Aggregations

SortCriteria (com.autentia.tnt.dao.SortCriteria)136 ArrayList (java.util.ArrayList)114 SelectItem (javax.faces.model.SelectItem)107 Organization (com.autentia.tnt.businessobject.Organization)15 User (com.autentia.tnt.businessobject.User)15 Department (com.autentia.tnt.businessobject.Department)9 Project (com.autentia.tnt.businessobject.Project)9 Position (com.autentia.tnt.businessobject.Position)7 Calendar (java.util.Calendar)7 GregorianCalendar (java.util.GregorianCalendar)7 Activity (com.autentia.tnt.businessobject.Activity)6 ProjectRole (com.autentia.tnt.businessobject.ProjectRole)6 ActivitySearch (com.autentia.tnt.dao.search.ActivitySearch)6 PositionSearch (com.autentia.tnt.dao.search.PositionSearch)6 Account (com.autentia.tnt.businessobject.Account)5 Contact (com.autentia.tnt.businessobject.Contact)5 Bill (com.autentia.tnt.businessobject.Bill)4 Inventary (com.autentia.tnt.businessobject.Inventary)4 AccountEntryType (com.autentia.tnt.businessobject.AccountEntryType)3 ExternalActivity (com.autentia.tnt.businessobject.ExternalActivity)3