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 List<ExcepcionPeajeVigencia> lsExcepcionPeajeVigencia;
private List<ExcepcionPeajeVigencia> 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<ExcepcionPeajeVigencia>();
excepcionPeaje = (ExcepcionPeaje) Executions.getCurrent().getArg().get("excepcionPeaje");
excepcionPeajeList = (MyListbox) Executions.getCurrent().getArg().get("excepcionPeajeList");
lsExcepcionPeaje = (ArrayList<ExcepcionPeaje>) 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);