Search in sources :

Example 26 with SortCriteria

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

the class BillBean method getProjects.

/**
 * Get the list of all projects
 *
 * @return the list of all projects
 */
public List<SelectItem> getProjects() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    List<Project> refs = ProjectManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    for (Project 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 27 with SortCriteria

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

the class CreditTitleBean method getBillss.

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

Example 28 with SortCriteria

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

the class CreditTitleBean method getOrganizations.

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

Example 29 with SortCriteria

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

the class AccountEntryBean method getAll.

/**
 * List accountEntrys. Order depends on Faces parameter sort.
 *
 * @return the list of all accountEntrys sorted by requested criterion
 */
public List<AccountEntry> getAll() {
    if (year == ALL_YEARS) {
        search.unsetYear();
    } else {
        search.setYear(year);
    }
    search.setHideInitialEntry(hideInitialEntry);
    if (accountSelected != ALL_ACCOUNTS) {
        search.setAccount(AccountManager.getDefault().getEntityById(accountSelected));
    } else {
        search.unsetAccount();
    }
    List<AccountEntry> res = manager.getAllEntities(search, new SortCriteria(sortColumn, sortAscending));
    calcTotals(res);
    return res;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) AccountEntry(com.autentia.tnt.businessobject.AccountEntry)

Example 30 with SortCriteria

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

the class AccountEntryBean method getAllAccounts.

public List<SelectItem> getAllAccounts() {
    FacesContext context = FacesContext.getCurrentInstance();
    Locale locale = context.getViewRoot().getLocale();
    ResourceBundle bundle = ResourceBundle.getBundle("com.autentia.tnt.resources.messages", locale);
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ret.add(new SelectItem(Integer.valueOf(ALL_ACCOUNTS), bundle.getString("accountEntry.allaccounts")));
    List<Account> refs = AccountManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    for (Account ref : refs) {
        ret.add(new SelectItem(ref.getId(), ref.getName()));
    }
    return ret;
}
Also used : Locale(java.util.Locale) SortCriteria(com.autentia.tnt.dao.SortCriteria) FacesContext(javax.faces.context.FacesContext) Account(com.autentia.tnt.businessobject.Account) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) ResourceBundle(java.util.ResourceBundle)

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