Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
  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;
  }
Ejemplo n.º 3
0
  /** 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!"));
      }
    }
  }
Ejemplo n.º 4
0
 @Override
 public List findAll() {
   return ejbFacade.findAll();
 }
Ejemplo n.º 5
0
 public List<TimeOff> findByEmployeeID(Employee empl) {
   List<TimeOff> all_items = ejbFacade.findByEmployeeID(empl);
   Collections.sort(all_items, Collections.reverseOrder());
   return all_items;
 }