Correcciones sobre interfaz.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package managedbean.visit;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.view.ViewScoped;
|
||||
import javax.inject.Named;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
@@ -14,21 +16,21 @@ import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
@Named("AddVisit")
|
||||
@RequestScoped
|
||||
@ViewScoped
|
||||
public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private Integer id;
|
||||
private Date date;
|
||||
private Time time;
|
||||
private LocalTime time;
|
||||
private String observations;
|
||||
private String result;
|
||||
private String patientDisplayName;
|
||||
private String familyDoctorDisplayName;
|
||||
private PatientTO patient;
|
||||
private FamilyDoctorTO familyDoctor;
|
||||
|
||||
|
||||
public AddVisitMBean() {
|
||||
}
|
||||
|
||||
@@ -36,15 +38,16 @@ public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
||||
public void init() {
|
||||
// El usuario actual es un medico de familia, recuperamos su Id de la sessión actual
|
||||
Integer patientId = Integer.valueOf(SessionUtils.getUserId());
|
||||
|
||||
|
||||
this.patient = this.getRemoteManagerCommon().findPatientById(patientId);
|
||||
this.familyDoctor = this.patient.getFamilyDoctor();
|
||||
|
||||
|
||||
this.date = new Date();
|
||||
}
|
||||
|
||||
|
||||
public void saveData() {
|
||||
// TODO: Añadir la nueva visita a la BBDD
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Visita creada", "La nueva visita se ha registrado correctamente en el sistema.");
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
@@ -55,11 +58,11 @@ public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Time getTime() {
|
||||
public LocalTime getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(Time time) {
|
||||
public void setTime(LocalTime time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user