Exemplo n.º 1
0
 public void disapproveRequest(UserRequest userRequest, Person evaluator) {
   RequestEvaluation requestEvaluation = new RequestEvaluation();
   requestEvaluation.setPerson(evaluator);
   requestEvaluation.setRequest(userRequest);
   requestEvaluation.setEvaluationDate(new Date());
   userRequest.setStatus(Constants.DISAPPROVED);
   this.insertRequestEvaluation(requestEvaluation);
   this.updateUserRequest(userRequest);
 }
Exemplo n.º 2
0
 public void approveRequest(UserRequest request, Person evaluator) {
   RequestEvaluation requestEvaluation = new RequestEvaluation();
   requestEvaluation.setPerson(evaluator);
   requestEvaluation.setRequest(request);
   requestEvaluation.setEvaluationDate(new Date());
   request.setStatus(Constants.APPROVED);
   this.insertRequestEvaluation(requestEvaluation);
   this.updateUserRequest(request);
   if (!request.isTeachingRequest()) {
     this.approveAssistantRequest(request, evaluator);
   }
 }
Exemplo n.º 3
0
 public void requestTeacherProfile(UserRequest userRequest) throws RequestException {
   List<UserRequest> results = searchTeachingRequest(userRequest.getPerson().getId());
   for (UserRequest request : results) {
     if (request.getStatus().equalsIgnoreCase("ag")) {
       throw new RequestException("errors.request.waiting");
     }
     if (request.getStatus().equalsIgnoreCase("ap")) {
       throw new RequestException("errors.request.approved");
     }
   }
   userRequest.setStatus("ag");
   insertUserRequest(userRequest);
 }
Exemplo n.º 4
0
 public void requestAssistance(UserRequest userRequest) throws RequestException {
   List<UserRequest> results =
       searchRequestByUserID(userRequest.getCourse().getId(), userRequest.getPerson().getId());
   for (UserRequest request : results) {
     if (request.getStatus().equalsIgnoreCase("ag")) {
       throw new RequestException("errors.request.waiting");
     }
     if (request.getStatus().equalsIgnoreCase("ap")) {
       throw new RequestException("errors.request.approved");
     }
   }
   userRequest.setStatus("ag");
   insertUserRequest(userRequest);
 }