From 79769b2929f2cf888c2458b47f67b9e419abef49 Mon Sep 17 00:00:00 2001 From: gleimar Date: Thu, 14 Mar 2013 14:11:38 +0000 Subject: [PATCH] - Nova funcionalidade de categoria com tempo para ativar e desativar git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@25194 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/CategoriaCtrl.java | 1 + .../entidad/CategoriaDescuento.java | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java index 5cdf449a0..8c6cd0493 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaCtrl.java @@ -12,6 +12,7 @@ import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java index a92a2166d..4c7f604dc 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java @@ -80,6 +80,11 @@ public class CategoriaDescuento implements Serializable { private Boolean indImporteTxEmbarque; @Column(name = "INDIMPORTEPEDAGIO") private Boolean indImportePedagio; + @Column(name = "TIEMPOACTIVAR") + private Integer tiempoActivar; + @Column(name = "TIEMPODESACTIVAR") + private Integer tiempoDesactivar; + public enum DisponibilidadeFeriado { // Declaração dos enum @@ -311,4 +316,37 @@ public class CategoriaDescuento implements Serializable { this.indImportePedagio = indImportePedagio; } + public Integer getTiempoActivar() { + return tiempoActivar; + } + + public void setTiempoActivar(Integer hora,Integer minuto) { + setTiempoDesactivar(null); + hora = (hora == null)?0:hora; + minuto = (minuto == null)?0:minuto; + + int totalMinutos = (hora*60)+minuto; + setTiempoActivar( (totalMinutos == 0)?null:totalMinutos); + } + + public void setTiempoActivar(Integer tiempoActivar) { + this.tiempoActivar = tiempoActivar; + } + + public Integer getTiempoDesactivar() { + return tiempoDesactivar; + } + + public void setTiempoDesactivar(Integer hora,Integer minuto) { + setTiempoActivar(null); + hora = (hora == null)?0:hora; + minuto = (minuto == null)?0:minuto; + + int totalMinutos = (hora*60)+minuto; + setTiempoDesactivar( (totalMinutos == 0)?null:totalMinutos); + } + + public void setTiempoDesactivar(Integer tiempoDesactivar) { + this.tiempoDesactivar = tiempoDesactivar; + } }