From 6d1b5ba8ee3954881d8ec8f6e1f09c91466eed96 Mon Sep 17 00:00:00 2001 From: wilian Date: Wed, 19 Aug 2015 19:54:22 +0000 Subject: [PATCH] fixes bug #6565 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@46918 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../pricing/EditarPricingController.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java index fbd96adda..402776223 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java @@ -860,8 +860,16 @@ public class EditarPricingController extends MyGenericForwardComposer { Messagebox.OK, Messagebox.INFORMATION); return false; } + + if (pricingRutaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.rutaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } - if (pricingRutaList.getModel().getSize() == 0 && verificarContemTodas()) { + if (verificarContemTodasRuta() && verificarContemTodas()) { Messagebox.show( Labels.getLabel("editarPricingController.MSG.rutaVazio"), Labels.getLabel("editarPricingController.window.title"), @@ -884,7 +892,7 @@ public class EditarPricingController extends MyGenericForwardComposer { return false; } - if (pricingMercadoList.getModel().getSize() == 0) { + if (pricingMercadoList.getModel().getSize() == 0 && verificarContemTodasRuta()) { Messagebox.show( Labels.getLabel("editarPricingController.MSG.mercadoVazio"), Labels.getLabel("editarPricingController.window.title"), @@ -895,6 +903,17 @@ public class EditarPricingController extends MyGenericForwardComposer { return true; } + private boolean verificarContemTodasRuta() { + Integer rutaIdTodas = -1; + for(int i = 0; i < pricingRutaList.getModel().getSize(); i++ ){ + PricingRuta princingRuta = (PricingRuta) pricingRutaList.getModel().getElementAt(i); + if(princingRuta.getRuta().getRutaId() == rutaIdTodas){ + return true; + } + } + return false; + } + private Boolean verificarContemTodas() { String TODAS = "TODAS"; for(int i = 0; i < pricingMercadoList.getModel().getSize(); i++ ){