Search in sources :

Example 1 with Account

use of com.autentia.tnt.businessobject.Account 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)

Example 2 with Account

use of com.autentia.tnt.businessobject.Account in project TNTConcept by autentia.

the class PeriodicalAccountEntryBean 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)

Example 3 with Account

use of com.autentia.tnt.businessobject.Account in project TNTConcept by autentia.

the class PeriodicalAccountEntryBean method getAccounts.

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

Example 4 with Account

use of com.autentia.tnt.businessobject.Account in project TNTConcept by autentia.

the class AccountEntryBean method getAccounts.

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

Example 5 with Account

use of com.autentia.tnt.businessobject.Account in project TNTConcept by autentia.

the class ReportBean method getAccounts.

public ArrayList<SelectItem> getAccounts() {
    final ArrayList<SelectItem> reto = new ArrayList<SelectItem>();
    final List<Account> refs = accountDAO.search(new SortCriteria("name"));
    for (Account ref : refs) {
        reto.add(new SelectItem(ref.getId().toString(), ref.getName()));
    }
    return reto;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Account(com.autentia.tnt.businessobject.Account) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Aggregations

Account (com.autentia.tnt.businessobject.Account)5 SortCriteria (com.autentia.tnt.dao.SortCriteria)5 ArrayList (java.util.ArrayList)5 SelectItem (javax.faces.model.SelectItem)5 Locale (java.util.Locale)2 ResourceBundle (java.util.ResourceBundle)2 FacesContext (javax.faces.context.FacesContext)2