Search in sources :

Example 1 with ProjectSearch

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

the class BillManager method getProjectsByOrganization.

/**
 * Busca todos los proyectos de una organizaciĆ³n
 *
 * @param client es la organizaciĆ³n por la que vamos a consultar
 * @return la lista de proyectos
 */
public List<Project> getProjectsByOrganization(Organization client) {
    final ProjectSearch projectSearch = new ProjectSearch();
    projectSearch.setClient(client);
    return ProjectDAO.getDefault().search(projectSearch, new SortCriteria("name"));
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) ProjectSearch(com.autentia.tnt.dao.search.ProjectSearch)

Example 2 with ProjectSearch

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

the class ProjectManager method getOpenProjects.

/* Project - generated by stajanov (do not edit/delete) */
public List<Project> getOpenProjects(SortCriteria sort) {
    ProjectSearch s = new ProjectSearch();
    s.setOpen(true);
    return getAllEntities(s, sort);
}
Also used : ProjectSearch(com.autentia.tnt.dao.search.ProjectSearch)

Example 3 with ProjectSearch

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

the class ReportBean method getProjects.

public ArrayList<SelectItem> getProjects() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ProjectSearch projectCriteria = new ProjectSearch();
    projectCriteria.setClient(getSelectedOrganization());
    List<Project> projects = projectDAO.getDefault().searchByOrganization(new SortCriteria("name"), getSelectedOrganization());
    if (!projects.isEmpty()) {
        setSelectedProject(projects.get(0));
    }
    for (Project project : projects) {
        ret.add(new SelectItem(project.getId().toString(), project.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Project(com.autentia.tnt.businessobject.Project) SelectItem(javax.faces.model.SelectItem) ProjectSearch(com.autentia.tnt.dao.search.ProjectSearch) ArrayList(java.util.ArrayList)

Aggregations

ProjectSearch (com.autentia.tnt.dao.search.ProjectSearch)3 SortCriteria (com.autentia.tnt.dao.SortCriteria)2 Project (com.autentia.tnt.businessobject.Project)1 ArrayList (java.util.ArrayList)1 SelectItem (javax.faces.model.SelectItem)1