Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #220 from CampusDual/BFS42024-289
Browse files Browse the repository at this point in the history
mensaje añadido
  • Loading branch information
Danielrey99 authored Jan 9, 2025
2 parents 95efd4c + 07fb2b4 commit 05022f4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
"abbreviation" : "Abbreviation",
"Alumno" : "Student",
"asistenciasSave":"Attendance saved correctly.",
"STUDENT_HAS_DOCUMENTS":"The student has documents and cannot be deleted",
"SelectColor": "Select a color: ",
"SelectedColor": "Selected color:"
}
4 changes: 4 additions & 0 deletions cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@
"abbreviation" : "Abreviatura",
"Alumno" : "Alumno",
"asistenciasSave":"Asistencias guardadas correctamente.",
"STUDENT_HAS_DOCUMENTS":"Este estudiante tiene documentos y no puede ser eliminado",

"SelectColor": "Selecciona un color: ",

"SelectedColor": "Color seleccionado:"

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.campusdual.cd2024bfs4g1.model.core.dao.StudentBootcampDao;
import com.campusdual.cd2024bfs4g1.model.core.dao.StudentDao;
import com.ontimize.jee.common.db.AdvancedEntityResult;
import com.ontimize.jee.common.db.NullValue;
import com.ontimize.jee.common.dto.EntityResult;
import com.ontimize.jee.common.dto.EntityResultMapImpl;
import com.ontimize.jee.common.exceptions.OntimizeJEERuntimeException;
Expand Down Expand Up @@ -50,6 +49,9 @@ public class StudentService implements IStudentService {
@Autowired
private UserDao userDao;

@Autowired
private StudentDocumentDao studentDocumentDao;

@Override
public EntityResult studentQuery(Map<String, Object> keysMap, List<String> attributes) throws OntimizeJEERuntimeException {
return this.daoHelper.query(this.studentDao, keysMap, attributes);
Expand Down Expand Up @@ -263,6 +265,10 @@ public EntityResult studentDelete(Map<String, Object> keyMap) throws OntimizeJEE
Map<String,Object> deletekey3 = new Hashtable<>();
deletekey3.put(EmploymentStatusHistoryDao.ATTR_STUDENT_ID,keyMap.get(StudentDao.STU_ID));
EntityResult query3 = this.daoHelper.query(this.employmentStatusHistoryDao,deletekey3,Arrays.asList(EmploymentStatusHistoryDao.ATTR_STUDENT_ID));
Map<String,Object> deletekey4 = new Hashtable<>();
deletekey4.put(StudentDocumentDao.ATTR_ID_STUDENT,keyMap.get(StudentDao.STU_ID));
EntityResult query4 = this.daoHelper.query(this.studentDocumentDao,deletekey4,Arrays.asList(StudentDocumentDao.ATTR_ID_STUDENT));


if(!query.isEmpty()){
EntityResult error = new EntityResultMapImpl();
Expand All @@ -279,6 +285,11 @@ public EntityResult studentDelete(Map<String, Object> keyMap) throws OntimizeJEE
error3.setCode(EntityResult.OPERATION_WRONG);
error3.setMessage("STUDENT_HAS_STATUS");
return error3;
}else if(!query4.isEmpty()){
EntityResult error4 = new EntityResultMapImpl();
error4.setCode(EntityResult.OPERATION_WRONG);
error4.setMessage("STUDENT_HAS_DOCUMENTS");
return error4;
}else {
return this.daoHelper.delete(this.studentDao, keyMap);
}
Expand Down

0 comments on commit 05022f4

Please sign in to comment.