Search in sources :

Example 91 with SortCriteria

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

the class BillExpirationDateBean method updateExpirationDate.

// private Set<BillPayment> billPayment = new LinkedHashSet<BillPayment>();
public void updateExpirationDate() {
    // TODO extract login name to a properties file
    authenticateAs(ConfigurationUtil.getDefault().getAdminUser());
    List<Bill> bills = BillManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    for (Bill b : bills) {
        Date creationDate = b.getCreationDate();
        creationDate.setMonth(creationDate.getMonth() + 1);
        if (!b.getBillPayment().isEmpty()) {
            for (BillPayment bp : b.getBillPayment()) {
                bp.setExpirationDate(creationDate);
            }
        } else {
            // creamos el billPayment para el expirationDate
            createBillPayment(b);
            for (BillPayment bp : b.getBillPayment()) {
                bp.setExpirationDate(creationDate);
            }
        }
    }
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) BillPayment(com.autentia.tnt.businessobject.BillPayment) Bill(com.autentia.tnt.businessobject.Bill) Date(java.util.Date)

Example 92 with SortCriteria

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

the class FinancialRatioBean method getFinancialRatiosWithNull.

/**
 * Get the list of all Financial Ratios
 * @return the list of all Financial Ratios
 */
public List<SelectItem> getFinancialRatiosWithNull() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    if (this.getId() != null) {
        search.setDifferentId(this.getId());
    }
    List<FinancialRatio> refs = manager.getAllEntities(search, new SortCriteria(sortColumn, sortAscending));
    for (FinancialRatio ref : refs) {
        ret.add(new SelectItem(ref, ref.getTitle()));
    }
    ret.add(0, new SelectItem("-- NINGUNO --"));
    search.unsetDifferentId();
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) FinancialRatio(com.autentia.tnt.businessobject.FinancialRatio)

Example 93 with SortCriteria

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

the class PositionBean method getAllTags.

public List<SelectItem> getAllTags() {
    final List<Tag> refs = TagManager.getDefault().getAllEntities(null, new SortCriteria("id"));
    final List<SelectItem> ret = new ArrayList<SelectItem>();
    for (Tag 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) Tag(com.autentia.tnt.businessobject.Tag)

Example 94 with SortCriteria

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

the class PositionBean method getAll.

/**
 * List positions. Order depends on Faces parameter sort.
 *
 * @return the list of all positions sorted by requested criterion
 */
public List<Position> getAll() {
    final PositionSearch allNotDeletedSearch = new PositionSearch();
    allNotDeletedSearch.setDeleted(false);
    return manager.getAllEntities(allNotDeletedSearch, new SortCriteria(sortColumn, sortAscending));
}
Also used : PositionSearch(com.autentia.tnt.dao.search.PositionSearch) SortCriteria(com.autentia.tnt.dao.SortCriteria)

Example 95 with SortCriteria

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

the class TagBean method getContactTagss.

/**
 * Get the list of all contactTagss
 *
 * @return the list of all contactTagss
 */
public List<SelectItem> getContactTagss() {
    List<Contact> refs = ContactManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    List<SelectItem> ret = new ArrayList<SelectItem>();
    for (Contact 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) Contact(com.autentia.tnt.businessobject.Contact)

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