예제 #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;
 }
예제 #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;
  }
예제 #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!"));
      }
    }
  }
예제 #4
0
 @Override
 public List findAll() {
   return ejbFacade.findAll();
 }
예제 #5
0
 public List<TimeOff> findByEmployeeID(Employee empl) {
   List<TimeOff> all_items = ejbFacade.findByEmployeeID(empl);
   Collections.sort(all_items, Collections.reverseOrder());
   return all_items;
 }