Multiples cambios para soportar la utilización de códigos de usuario
únicos para (Pacientes, medicos de familia, medicos especialista y administradores). Nuevos métodos en EJB común para consultar Entidades por Id y por código (Para el login).
This commit is contained in:
@@ -36,8 +36,8 @@ import managedbean.common.ValidationUtils;
|
||||
public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int id;
|
||||
private String cipCode;
|
||||
private String nif;
|
||||
private String name;
|
||||
private String surname;
|
||||
@@ -185,14 +185,6 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
this.nif = nif;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void addNewUser() {
|
||||
int error = 0;
|
||||
|
||||
@@ -214,17 +206,17 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
switch (UserType.valueOf(this.userType)) {
|
||||
case PATIENT:
|
||||
PatientTO pat = this.getRemoteManagerProfile().registerPatient(id, nif, name, surname, password, email);
|
||||
this.id = pat.getId();
|
||||
this.cipCode = pat.getPersonalIdentificationCode();
|
||||
|
||||
break;
|
||||
case FAMILY_DOCTOR:
|
||||
FamilyDoctorTO fd = this.getRemoteManagerProfile().registerFamilyDoctor(id, nif, name, surname, password, email, this.primaryHealthCareCenter);
|
||||
this.id = fd.getId();
|
||||
this.cipCode = fd.getProfessionalNumber();
|
||||
|
||||
break;
|
||||
case SPECIALIST_DOCTOR:
|
||||
SpecialistDoctorTO sd = this.getRemoteManagerProfile().registerSpecialistDoctor(id, nif, name, surname, password, email, this.medicalSpecialty);
|
||||
this.id = sd.getId();
|
||||
this.cipCode = sd.getProfessionalNumber();
|
||||
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
@@ -268,4 +260,12 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
return registered;
|
||||
}
|
||||
|
||||
public String getCipCode() {
|
||||
return cipCode;
|
||||
}
|
||||
|
||||
public void setCipCode(String cipCode) {
|
||||
this.cipCode = cipCode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user