CAmbiado tipo de datos para manejar Horas a LocalTime.
This commit is contained in:
@@ -2,7 +2,7 @@ package managedbean.visit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -22,19 +22,20 @@ import managedbean.common.ManagedBeanBase;
|
||||
public class VisitMBean 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 PatientTO patient;
|
||||
private FamilyDoctorTO familyDoctor;
|
||||
private String fromPage;
|
||||
|
||||
|
||||
public VisitMBean() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// Inicialización de variables y propiedades van aquí.
|
||||
@@ -43,18 +44,18 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
||||
Map<String, String> requestParams = context.getExternalContext().getRequestParameterMap();
|
||||
|
||||
VisitTO vi = null;
|
||||
|
||||
|
||||
try {
|
||||
this.fromPage = requestParams.get("fromPage");
|
||||
|
||||
|
||||
// Parámetro con el "id" de la visita.
|
||||
int parId = Integer.valueOf(requestParams.get("id"));
|
||||
|
||||
|
||||
vi = this.getRemoteManagerVisit().getVisit(parId);
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
|
||||
|
||||
if (vi != null) {
|
||||
this.id = vi.getId();
|
||||
this.date = vi.getDate();
|
||||
@@ -64,13 +65,14 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
||||
this.patient = vi.getPatient();
|
||||
this.familyDoctor = vi.getFamilyDoctor();
|
||||
} else {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Identificador de visita no válido", "No se ha podido recuperar el identificador de visita especificado. Por favor, vuelva a intentarlo seleccionando de nuevo la visita.");
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Identificador de visita no válido",
|
||||
"No se ha podido recuperar el identificador de visita especificado. Por favor, vuelva a intentarlo seleccionando de nuevo la visita.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void editVisit(Integer visitId) throws IOException {
|
||||
FacesContext ctx = FacesContext.getCurrentInstance();
|
||||
ctx.getExternalContext().redirect(String.format("UpdateVisit.xhtml?id=%d&fromPage=%s", visitId, this.fromPage));
|
||||
ctx.getExternalContext().redirect(String.format("UpdateVisit.xhtml?id=%d&fromPage=%s", visitId, this.fromPage));
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
@@ -81,11 +83,11 @@ public class VisitMBean 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