BusinessRuleException bre = new BusinessRuleException();
if(vo == null) {
throw new IllegalArgumentException("Cannot update a null ScienceProject.");
}
if(StringUtils.isNotBlank(vo.getCreator())) {
SeteUser creator = userDao.findById(Integer.valueOf(vo.getCreator()));
if( projectDao.isStudentInAnotherProject(Integer.valueOf(vo.getCreator())) &&
!(projectDao.findBy(creator).getIdAsString().equals(vo.getProjId())) ){
bre.addCodedMessage("scienceProject.error.student.already.projectMember",
new String[]{creator.getFirstName() + " " + creator.getLastName()});
throw bre;
}
}
if(StringUtils.isNotBlank(vo.getPartner())){
SeteUser partner = userDao.findById(Integer.valueOf(vo.getPartner()));
if( projectDao.isStudentInAnotherProject(Integer.valueOf(vo.getPartner())) &&
!(projectDao.findBy(partner).getIdAsString().equals(vo.getProjId())) ){
bre.addCodedMessage("scienceProject.error.student.already.projectMember",
new String[]{partner.getFirstName() + " " + partner.getLastName()});
throw bre;
}
}
if(StringUtils.isNotBlank(vo.getPartner()) &&