igor.rodrigo 2015-07-30 19:08:49 +00:00
parent da2a0c398c
commit 3e9a4faabf
1 changed files with 14 additions and 1 deletions

View File

@ -860,7 +860,8 @@ public class EditarPricingController extends MyGenericForwardComposer {
Messagebox.OK, Messagebox.INFORMATION); Messagebox.OK, Messagebox.INFORMATION);
return false; return false;
} }
if (pricingRutaList.getModel().getSize() == 0) {
if (pricingRutaList.getModel().getSize() == 0 && verificarContemTodas()) {
Messagebox.show( Messagebox.show(
Labels.getLabel("editarPricingController.MSG.rutaVazio"), Labels.getLabel("editarPricingController.MSG.rutaVazio"),
Labels.getLabel("editarPricingController.window.title"), Labels.getLabel("editarPricingController.window.title"),
@ -894,6 +895,17 @@ public class EditarPricingController extends MyGenericForwardComposer {
return true; return true;
} }
private Boolean verificarContemTodas() {
String TODAS = "TODAS";
for(int i = 0; i < pricingMercadoList.getModel().getSize(); i++ ){
PricingMercado princingMercado = (PricingMercado) pricingMercadoList.getModel().getElementAt(i);
if(princingMercado.getOrigen().getDescparada().equals(TODAS) || princingMercado.getDestino().getDescparada().equals(TODAS)){
return true;
}
}
return false;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void onClick$btnSalvar(Event ev) throws InterruptedException { public void onClick$btnSalvar(Event ev) throws InterruptedException {
if (!validarObligatorios()) { if (!validarObligatorios()) {
@ -1677,6 +1689,7 @@ public class EditarPricingController extends MyGenericForwardComposer {
Map args = new HashMap(); Map args = new HashMap();
args.put("pricingMercado", pMercado); args.put("pricingMercado", pMercado);
args.put("pricingMercadoList", pricingMercadoList); args.put("pricingMercadoList", pricingMercadoList);
//args.put("lsPricingMercado", lsPricingMercado);
openWindowPosi("/gui/pricing/editarPricingMercado.zul", openWindowPosi("/gui/pricing/editarPricingMercado.zul",
Labels.getLabel("editarPricingController.windowMercado.title"), args, MODAL, "center,top"); Labels.getLabel("editarPricingController.windowMercado.title"), args, MODAL, "center,top");