diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarExcepcionPeajeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarExcepcionPeajeController.java index cef11e7a1..d407101d3 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarExcepcionPeajeController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarExcepcionPeajeController.java @@ -62,6 +62,7 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { private MyListbox excepcionPeajeVigenciaList; private List lsExcepcionPeajeVigencia; + private List excepcionPeajeVigenciaToDelete; private ExcepcionPeajeVigencia excepcionPeajeVigencia; private Datebox fecInicio; @@ -139,6 +140,8 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); + excepcionPeajeVigenciaToDelete = new ArrayList(); + excepcionPeaje = (ExcepcionPeaje) Executions.getCurrent().getArg().get("excepcionPeaje"); excepcionPeajeList = (MyListbox) Executions.getCurrent().getArg().get("excepcionPeajeList"); lsExcepcionPeaje = (ArrayList) Executions.getCurrent().getArg().get("lsExcepcionPeaje"); @@ -334,6 +337,10 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { Collections.sort(lsExcepcionPeaje); excepcionPeajeList.setData(lsExcepcionPeaje); } + + if (!excepcionPeajeVigenciaToDelete.isEmpty()) { + excepcionPeajeService.deletarVigencias(excepcionPeajeVigenciaToDelete); + } Messagebox.show( Labels.getLabel("busquedaExcepcionPeajeController.MSG.suscribirOK"), Labels.getLabel("busquedaExcepcionPeajeController.window.title"), @@ -383,6 +390,8 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { closeWindow(); } + + public void onClick$btnRemoverExcepcionPeajeVigencia(Event ev) { ExcepcionPeajeVigencia epv = (ExcepcionPeajeVigencia) excepcionPeajeVigenciaList.getSelected(); if(epv != null){ @@ -394,7 +403,7 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { excepcionPeajeVigenciaList.setData(lsExcepcionPeajeVigencia); excepcionPeaje.setLsExcepcionPeajeVigencia(lsExcepcionPeajeVigencia); if(epv.getExcepcionPeajeVigenciaId() != null){ - excepcionPeaje.getLsExcepcionPeajeVigencia().add(epv); + excepcionPeajeVigenciaToDelete.add(epv); } } } @@ -485,6 +494,7 @@ public class EditarExcepcionPeajeController extends MyGenericForwardComposer { } return; } + lsExcepcionPeajeVigencia.add(excepcionPeajeVigencia); if(null != lsExcepcionPeajeVigencia){ Collections.sort(lsExcepcionPeajeVigencia);