frederico 2016-07-25 19:06:35 +00:00
parent d7b24184c7
commit a6bfda362d
1 changed files with 11 additions and 1 deletions

View File

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