public List<TimeOff> getFilteredTimeOffs() { switch (current_filter) { case "Current + Future": filteredTimeOffs = ejbFacade.findAfterAndNow(); break; case "Previous": filteredTimeOffs = ejbFacade.findBeforeNow(); break; case "All": filteredTimeOffs = ejbFacade.findAll(); } return filteredTimeOffs; }
public List<TimeOff> getActiveTimeOffs() { List<TimeOff> all_items = ejbFacade.findAll(); activeTimeOffs = new ArrayList(); for (TimeOff to : all_items) { if (to.getEmployeeid().getIsActive()) { activeTimeOffs.add(to); } } Collections.sort(activeTimeOffs, Collections.reverseOrder()); return activeTimeOffs; }
/** Checks if there are pending time off requests. Displays a message if some are found. */ public void checkForPendingRequests() { TimeOffStatus pending = ConfigurationDataManager.getInstance().getDefaultStatus(); if (pending != null) { if (ejbFacade.findByStatus(pending).size() > 0) { FacesContext.getCurrentInstance() .addMessage( null, new FacesMessage( FacesMessage.SEVERITY_WARN, "Time Off Requests Pending", "You have pending time off requests!")); } } }
@Override public List findAll() { return ejbFacade.findAll(); }
public List<TimeOff> findByEmployeeID(Employee empl) { List<TimeOff> all_items = ejbFacade.findByEmployeeID(empl); Collections.sort(all_items, Collections.reverseOrder()); return all_items; }