From 8d8d5b38925c880d8ed78d788048a2f93269a50f Mon Sep 17 00:00:00 2001 From: gleimar Date: Fri, 25 Jan 2013 12:25:59 +0000 Subject: [PATCH] git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@23885 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../BusquedaTarifaOficialController.java | 107 +++++++----------- web/WEB-INF/i3-label_pt_BR.label | 2 +- 2 files changed, 41 insertions(+), 68 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaOficialController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaOficialController.java index 7e2f0d8a8..32c31131f 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaOficialController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaOficialController.java @@ -4,33 +4,11 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; -import com.rjconsultores.ventaboletos.entidad.Categoria; -import com.rjconsultores.ventaboletos.entidad.ClaseServicio; -import com.rjconsultores.ventaboletos.entidad.Marca; -import com.rjconsultores.ventaboletos.entidad.Moneda; -import com.rjconsultores.ventaboletos.entidad.Parada; -import com.rjconsultores.ventaboletos.entidad.TarifaOficial; -import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; -import com.rjconsultores.ventaboletos.entidad.Tramo; - -import com.rjconsultores.ventaboletos.service.CategoriaService; -import com.rjconsultores.ventaboletos.service.ClaseServicioService; -import com.rjconsultores.ventaboletos.service.MarcaService; -import com.rjconsultores.ventaboletos.service.MonedaService; -import com.rjconsultores.ventaboletos.service.ParadaService; -import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; -import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; - -import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; -import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; -import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; -import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; -import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaOficial; -import com.trg.search.Filter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; @@ -43,6 +21,22 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Combobox; import org.zkoss.zul.Paging; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TarifaOficial; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaOficial; + /** * * @author rodrigo @@ -148,11 +142,11 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer { this.tarifaList = tarifaList; } - public void onClick$btnPesquisa(Event ev) { + public void onClick$btnPesquisa(Event ev) throws InterruptedException { refreshLista(); } - public void onClick$btnRefresh(Event ev) { + public void onClick$btnRefresh(Event ev) throws InterruptedException { refreshLista(); } @@ -200,7 +194,7 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer { Labels.getLabel("editarTarifaOficialController.window.title"), args, MODAL); } - private void refreshLista() { + private void refreshLista() throws InterruptedException { Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); @@ -220,61 +214,45 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer { } if ((marca == null) && (!cmbMarca.getText().isEmpty())) { - try { - Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Marca.", - Labels.getLabel("editarTarifaOficialController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Marca.", + Labels.getLabel("editarTarifaOficialController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); - return; - } catch (Exception ex) { - log.error(ex); - } + return; } if ((claseServicio == null) && (!cmbClaseServicio.getText().isEmpty())) { - try { - Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Clase servicio.", - Labels.getLabel("editarTarifaOficialController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Clase servicio.", + Labels.getLabel("editarTarifaOficialController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); - return; - } catch (Exception ex) { - log.error(ex); - } + return; } if ((origem == null) && (!cmbOrigem.getText().isEmpty())) { - try { - Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Origen.", - Labels.getLabel("editarTarifaOficialController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Origen.", + Labels.getLabel("editarTarifaOficialController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); - return; - } catch (Exception ex) { - log.error(ex); - } + return; } if ((destino == null) && (!cmbDestino.getText().isEmpty())) { - try { - Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Destino.", - Labels.getLabel("editarTarifaOficialController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Destino.", + Labels.getLabel("editarTarifaOficialController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); - return; - } catch (Exception ex) { - log.error(ex); - } + return; } - HibernateSearchObject tarifaBusqueda = - new HibernateSearchObject(TarifaOficial.class, pagingTarifaOficial.getPageSize()); + HibernateSearchObject tarifaBusqueda =new HibernateSearchObject(TarifaOficial.class, pagingTarifaOficial.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); - tarifaBusqueda.addFilterEqual("moneda", moneda); + if(marca != null){ tarifaBusqueda.addFilterEqual("marca", marca); }else{ @@ -287,12 +265,7 @@ public class BusquedaTarifaOficialController extends MyGenericForwardComposer { plwTarifaOficial.init(tarifaBusqueda, tarifaList, pagingTarifaOficial); if (tarifaList.getData().length == 0) { - try { - Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), - Labels.getLabel("editarTarifaOficialController.window.title"), - Messagebox.OK, Messagebox.INFORMATION); - } catch (InterruptedException ex) { - } + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),Labels.getLabel("editarTarifaOficialController.window.title"),Messagebox.OK, Messagebox.INFORMATION); } } } diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index d310156e8..93c1223d9 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -7,7 +7,7 @@ # . . = XXX #Versao do VentaBoleto: -versao = ADM_20130123_1RC98 +versao = ADM_20130125_1RC99 # MSG Defaut: MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100