コード例 #1
0
 public boolean canRequestAssistance(Person person, Course course) {
   List<UserRequest> results = searchRequestByUserID(course.getId(), person.getId());
   for (UserRequest request : results) {
     if (request.getStatus().equalsIgnoreCase("ag")) return false;
     if (request.getStatus().equalsIgnoreCase("ap")) return false;
   }
   return true;
 }
コード例 #2
0
 public boolean hasVacancy(Course course, Role role) {
   List<PersonRoleCourse> results = prcRepository.findCurso(course, role);
   int registereds = results.size();
   if (results.isEmpty() || registereds < course.getStudents()) {
     return true;
   } else {
     return false;
   }
 }