Correciones página gestión especialidades
This commit is contained in:
@@ -95,11 +95,11 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
||||
public void saveData() {
|
||||
int error = 0;
|
||||
|
||||
if (this.medicalSpecialty.getName() == null) {
|
||||
if (this.medicalSpecialty.getName() == null || this.medicalSpecialty.getName().trim().length() == 0) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nombre no relleno", "Por favor, escriba un nombre de especialidad.");
|
||||
error++;
|
||||
}
|
||||
if (this.medicalSpecialty.getDescription() == null) {
|
||||
if (this.medicalSpecialty.getDescription() == null || this.medicalSpecialty.getDescription().trim().length() == 0) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Descripción no rellena", "Por favor, escriba una descripción.");
|
||||
error++;
|
||||
}
|
||||
@@ -109,6 +109,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
||||
MedicalSpecialtyTO ms = this.getRemoteManagerSystemAdmin().updateSpecialtyData(this.medicalSpecialty.getId(), this.medicalSpecialty.getName(), this.medicalSpecialty.getDescription());
|
||||
this.setSpecialtyData(ms);
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los datos se han guardado", "Los datos de la especialidad se han guardado correctamente.");
|
||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
@@ -131,6 +132,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
||||
try {
|
||||
this.getRemoteManagerSystemAdmin().deleteSpecialtyData(this.medicalSpecialty.getId(), this.medicalSpecialty.getName(), this.medicalSpecialty.getDescription());
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los especialidad se ha borrado", "Los datos de la especialidad se han borrado correctamente.");
|
||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
@@ -154,6 +156,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
||||
MedicalSpecialtyTO ms = this.getRemoteManagerSystemAdmin().insertSpecialtyData(name, description);
|
||||
this.setSpecialtyData(ms);
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los datos se han guardado", "Los datos de la especialidad se han guardado correctamente.");
|
||||
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user