rodrigo 2012-08-21 18:12:02 +00:00
parent 9ff6c47065
commit 161ae920e3
7 changed files with 471 additions and 675 deletions

View File

@ -35,212 +35,157 @@ import org.zkoss.zul.Paging;
import org.zkoss.zul.Radio;
/**
*
*
* @author Administrador
*/
@Controller("busquedaAlertaCtrlController")
@Scope("prototype")
public class BusquedaAlertaCtrlController extends MyGenericForwardComposer {
@Autowired
private transient PagedListWrapper<AlertaCtrl> plwAlertaCtrl;
@Autowired
private RutaService rutaService;
@Autowired
private ClaseServicioService claseServicioService;
private List<ClaseServicio> lsClaseServicio;
private MyListbox alertaCtrlList;
private Paging pagingAlertaCtrl;
private Combobox cmbRuta;
private Combobox cmbOrigem;
private Combobox cmbDestino;
private Combobox cmbClaseServicio;
private List<Ruta> lsRuta;
private Intbox txtIdCorrida;
private Radio rdAlta;
private Radio rdBaja;
private Radio rdAmbas;
private static final long serialVersionUID = 1L;
@Autowired
private transient PagedListWrapper<AlertaCtrl> plwAlertaCtrl;
@Autowired
private RutaService rutaService;
@Autowired
private ClaseServicioService claseServicioService;
private List<ClaseServicio> lsClaseServicio;
private MyListbox alertaCtrlList;
private Paging pagingAlertaCtrl;
private Combobox cmbRuta;
private Combobox cmbOrigem;
private Combobox cmbDestino;
private Combobox cmbClaseServicio;
private List<Ruta> lsRuta;
private Intbox txtIdCorrida;
private Radio rdAlta;
private Radio rdBaja;
public MyListbox getAlertaCtrlList() {
return alertaCtrlList;
}
public List<Ruta> getLsRuta() {
return lsRuta;
}
public void setAlertaCtrlList(MyListbox alertaCtrlList) {
this.alertaCtrlList = alertaCtrlList;
}
public void setLsRuta(List<Ruta> lsRuta) {
this.lsRuta = lsRuta;
}
public Combobox getCmbClaseServicio() {
return cmbClaseServicio;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
public void setCmbClaseServicio(Combobox cmbClaseServicio) {
this.cmbClaseServicio = cmbClaseServicio;
}
lsRuta = new ArrayList<Ruta>();
public Combobox getCmbDestino() {
return cmbDestino;
}
alertaCtrlList.setItemRenderer(new RenderAlertaCtrl());
alertaCtrlList.addEventListener("onDoubleClick", new EventListener() {
public void setCmbDestino(Combobox cmbDestino) {
this.cmbDestino = cmbDestino;
}
@Override
public void onEvent(Event event) throws Exception {
AlertaCtrl c = (AlertaCtrl) alertaCtrlList.getSelected();
verAlertaCtrl(c);
}
});
public Combobox getCmbOrigem() {
return cmbOrigem;
}
refreshLista();
public void setCmbOrigem(Combobox cmbOrigem) {
this.cmbOrigem = cmbOrigem;
}
lsClaseServicio = claseServicioService.obtenerTodos();
BindingListModelList modelClaseServicio = new BindingListModelList(lsClaseServicio, true);
cmbClaseServicio.setModel(modelClaseServicio);
public Combobox getCmbRuta() {
return cmbRuta;
}
cmbClaseServicio.focus();
}
public void setCmbRuta(Combobox cmbRuta) {
this.cmbRuta = cmbRuta;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void verAlertaCtrl(AlertaCtrl a) {
if (a == null) {
return;
}
public List<Ruta> getLsRuta() {
return lsRuta;
}
Map args = new HashMap();
args.put("alertaCtrl", a);
args.put("alertaCtrlList", alertaCtrlList);
public void setLsRuta(List<Ruta> lsRuta) {
this.lsRuta = lsRuta;
}
openWindow("/gui/configuraciones_comerciales/editarAlertaCtrl.zul",
Labels.getLabel("busquedaAlertaCtrlController.window.title"), args, MODAL);
}
public Paging getPagingAlertaCtrl() {
return pagingAlertaCtrl;
}
private void refreshLista() {
HibernateSearchObject<AlertaCtrl> alertaCtrlBusqueda =
new HibernateSearchObject<AlertaCtrl>(AlertaCtrl.class,
pagingAlertaCtrl.getPageSize());
alertaCtrlBusqueda.addFilterEqual("activo", Boolean.TRUE);
public void setPagingAlertaCtrl(Paging pagingAlertaCtrl) {
this.pagingAlertaCtrl = pagingAlertaCtrl;
}
Comboitem cbiRuta = cmbRuta.getSelectedItem();
if (cbiRuta != null) {
Ruta ruta = (Ruta) cbiRuta.getValue();
alertaCtrlBusqueda.addFilterEqual("ruta", ruta);
}
public Intbox getTxtIdCorrida() {
return txtIdCorrida;
}
Comboitem cbiOrigem = cmbOrigem.getSelectedItem();
if (cbiOrigem != null) {
Parada origem = (Parada) cbiOrigem.getValue();
alertaCtrlBusqueda.addFilterEqual("origem", origem);
}
public void setTxtIdCorrida(Intbox txtIdCorrida) {
this.txtIdCorrida = txtIdCorrida;
}
Comboitem cbiDestino = cmbDestino.getSelectedItem();
if (cbiDestino != null) {
Parada destino = (Parada) cbiDestino.getValue();
alertaCtrlBusqueda.addFilterEqual("destino", destino);
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem();
if (cbiClaseServicio != null) {
ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue();
alertaCtrlBusqueda.addFilterEqual("claseServicio", claseServicio);
}
lsRuta = new ArrayList<Ruta>();
Integer idCorrida = txtIdCorrida.getValue();
if (idCorrida != null) {
alertaCtrlBusqueda.addFilterEqual("corrida.id.corridaId", idCorrida);
}
alertaCtrlList.setItemRenderer(new RenderAlertaCtrl());
alertaCtrlList.addEventListener("onDoubleClick", new EventListener() {
if (rdAlta.isChecked()) {
alertaCtrlBusqueda.addFilterNotNull("porcalta");
alertaCtrlBusqueda.addFilterNull("porcbaja");
} else if (rdBaja.isChecked()) {
alertaCtrlBusqueda.addFilterNotNull("porcbaja");
alertaCtrlBusqueda.addFilterNull("porcalta");
}
@Override
public void onEvent(Event event) throws Exception {
AlertaCtrl c = (AlertaCtrl) alertaCtrlList.getSelected();
verAlertaCtrl(c);
}
});
plwAlertaCtrl.init(alertaCtrlBusqueda, alertaCtrlList, pagingAlertaCtrl);
if (alertaCtrlList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
refreshLista();
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
lsClaseServicio = claseServicioService.obtenerTodos();
BindingListModelList modelClaseServicio = new BindingListModelList(lsClaseServicio, true);
cmbClaseServicio.setModel(modelClaseServicio);
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
cmbClaseServicio.focus();
}
public void onClick$btnNovo(Event ev) {
verAlertaCtrl(new AlertaCtrl());
}
private void verAlertaCtrl(AlertaCtrl a) {
if (a == null) {
return;
}
public void onChange$cmbClaseServicio(Event ev) {
Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem();
Map args = new HashMap();
args.put("alertaCtrl", a);
args.put("alertaCtrlList", alertaCtrlList);
if (cbiClaseServicio != null) {
ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue();
lsRuta = rutaService.buscarPorClaseServicio(claseServicio);
openWindow("/gui/configuraciones_comerciales/editarAlertaCtrl.zul",
Labels.getLabel("busquedaAlertaCtrlController.window.title"), args, MODAL);
}
cmbRuta.setSelectedItem(null);
cmbRuta.setText(null);
private void refreshLista() {
HibernateSearchObject<AlertaCtrl> alertaCtrlBusqueda =
new HibernateSearchObject<AlertaCtrl>(AlertaCtrl.class,
pagingAlertaCtrl.getPageSize());
alertaCtrlBusqueda.addFilterEqual("activo", Boolean.TRUE);
Comboitem cbiRuta = cmbRuta.getSelectedItem();
if (cbiRuta != null) {
Ruta ruta = (Ruta) cbiRuta.getValue();
alertaCtrlBusqueda.addFilterEqual("ruta", ruta);
}
Comboitem cbiOrigem = cmbOrigem.getSelectedItem();
if (cbiOrigem != null) {
Parada origem = (Parada) cbiOrigem.getValue();
alertaCtrlBusqueda.addFilterEqual("origem", origem);
}
Comboitem cbiDestino = cmbDestino.getSelectedItem();
if (cbiDestino != null) {
Parada destino = (Parada) cbiDestino.getValue();
alertaCtrlBusqueda.addFilterEqual("destino", destino);
}
Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem();
if (cbiClaseServicio != null) {
ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue();
alertaCtrlBusqueda.addFilterEqual("claseServicio", claseServicio);
}
Integer idCorrida = txtIdCorrida.getValue();
if (idCorrida != null) {
alertaCtrlBusqueda.addFilterEqual("corrida.id.corridaId", idCorrida);
}
if (rdAlta.isChecked()) {
alertaCtrlBusqueda.addFilterNotNull("porcalta");
alertaCtrlBusqueda.addFilterNull("porcbaja");
} else if (rdBaja.isChecked()) {
alertaCtrlBusqueda.addFilterNotNull("porcbaja");
alertaCtrlBusqueda.addFilterNull("porcalta");
}
plwAlertaCtrl.init(alertaCtrlBusqueda, alertaCtrlList, pagingAlertaCtrl);
if (alertaCtrlList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("busquedaAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnNovo(Event ev) {
verAlertaCtrl(new AlertaCtrl());
}
public void onChange$cmbClaseServicio(Event ev) {
Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem();
if (cbiClaseServicio != null) {
ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue();
lsRuta = rutaService.buscarPorClaseServicio(claseServicio);
cmbRuta.setSelectedItem(null);
cmbRuta.setText(null);
BindingListModelList modelRuta = new BindingListModelList(lsRuta, true);
cmbRuta.setModel(modelRuta);
}
}
BindingListModelList modelRuta = new BindingListModelList(lsRuta, true);
cmbRuta.setModel(modelRuta);
}
}
}

View File

@ -54,7 +54,8 @@ import org.zkoss.zul.Tab;
*/
@Controller("editarAlertaCtrlController")
@Scope("prototype")
public class EditarAlertaCtrlController extends MyGenericForwardComposer implements ListitemRenderer {
public class EditarAlertaCtrlController extends MyGenericForwardComposer
implements ListitemRenderer {
private static final long serialVersionUID = 1L;
@Autowired
@ -112,38 +113,6 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
this.alertaCtrl = alertaCtrl;
}
public MyListbox getAlertaCtrlList() {
return alertaCtrlList;
}
public void setAlertaCtrlList(MyListbox alertaCtrlList) {
this.alertaCtrlList = alertaCtrlList;
}
public Button getBtnApagar() {
return btnApagar;
}
public void setBtnApagar(Button btnApagar) {
this.btnApagar = btnApagar;
}
public Combobox getCmbClaseServicio() {
return cmbClaseServicio;
}
public void setCmbClaseServicio(Combobox cmbClaseServicio) {
this.cmbClaseServicio = cmbClaseServicio;
}
public Combobox getCmbRuta() {
return cmbRuta;
}
public void setCmbRuta(Combobox cmbRuta) {
this.cmbRuta = cmbRuta;
}
public List<ClaseServicio> getLsClaseServicio() {
return lsClaseServicio;
}
@ -160,14 +129,6 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
this.lsRuta = lsRuta;
}
public Intbox getTxtIdCorrida() {
return txtIdCorrida;
}
public void setTxtIdCorrida(Intbox txtIdCorrida) {
this.txtIdCorrida = txtIdCorrida;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
@ -189,7 +150,6 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
btnApagar.setVisible(Boolean.FALSE);
tabGenerico.setVisible(Boolean.FALSE);
tabCorrida.setVisible(Boolean.FALSE);
} else {
if (alertaCtrl.getCorrida() != null) {
List<Corrida> lsCorridas = new ArrayList<Corrida>();
@ -227,9 +187,11 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
if (alertaCtrl.getInddomingo() == Boolean.TRUE) {
rdDom.setChecked(true);
}
corrida();
} else {
generico();
if (alertaCtrl.getOrigem() != null) {
cmbOrigem.setText(alertaCtrl.getOrigem().getDescparada());
}
@ -292,11 +254,13 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
txtPorcCorrida.getValue();
txtTiempoCorrida.getValue();
if (alertaCtrl.getCorrida() == null) {
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.seleccionar.corrida"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.seleccionar.corrida"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
if (!rdLun.isChecked() && !rdMar.isChecked() && !rdMie.isChecked() && !rdJue.isChecked() && !rdVie.isChecked() && !rdSab.isChecked() && !rdDom.isChecked()) {
Clients.alert(Labels.getLabel("editarAlertaCtrlController.MSG.obligatorioDia"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.EXCLAMATION);
Clients.alert(Labels.getLabel("editarAlertaCtrlController.MSG.obligatorioDia"),
Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.EXCLAMATION);
return;
}
@ -304,8 +268,9 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
try {
if (isGenerico) {
if (!rdAlta.isChecked() && !rdBaja.isChecked()) {
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
} else if (rdAlta.isChecked()) {
alertaCtrl.setPorcalta(txtPorc.getValueDecimal());
@ -324,7 +289,10 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
if (origem != null) {
alertaCtrl.setOrigem(origem);
} else {
Messagebox.show(Labels.getLabel("MSG.necesita.origen"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("MSG.necesita.origen"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
@ -332,7 +300,10 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
if (destino != null) {
alertaCtrl.setDestino(destino);
} else {
Messagebox.show(Labels.getLabel("MSG.necesita.destino"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("MSG.necesita.destino"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
@ -347,8 +318,10 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
}
} else {
if (!rdAltaCorrida.isChecked() && !rdBajaCorrida.isChecked()) {
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
} else if (rdAltaCorrida.isChecked()) {
alertaCtrl.setPorcalta(txtPorcCorrida.getValueDecimal());
@ -363,6 +336,7 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
alertaCtrl.setTiempoalta(null);
alertaCtrl.setTiempobaja(txtTiempoCorrida.getValue());
}
alertaCtrl.setRuta(alertaCtrl.getCorrida().getRuta());
alertaCtrl.setClaseServicio(alertaCtrl.getCorrida().getClaseServicio());
alertaCtrl.setOrigem(alertaCtrl.getCorrida().getOrigem());
@ -380,7 +354,8 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
BigDecimal percAlta = alertaCtrl.getPorcalta();
BigDecimal percBaja = alertaCtrl.getPorcbaja();
lsAlertaCtrl = arlertaCtrlService.buscar(alertaCtrl.getOrigem(), alertaCtrl.getDestino(), alertaCtrl.getRuta(), alertaCtrl.getClaseServicio(), tiempoAlta,
lsAlertaCtrl = arlertaCtrlService.buscar(alertaCtrl.getOrigem(), alertaCtrl.getDestino(),
alertaCtrl.getRuta(), alertaCtrl.getClaseServicio(), tiempoAlta,
tiempoBaja, percAlta, percBaja);
boolean podeSalvar = false;
@ -397,7 +372,10 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
}
if (!podeSalvar) {
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("MSG.Registro.Existe"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
} else {
@ -410,8 +388,10 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
alertaCtrl.setInddomingo(rdDom.isChecked() ? Boolean.TRUE : Boolean.FALSE);
if (!noTraslapa()) {
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.traslapa"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.EXCLAMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.traslapa"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
}
@ -422,30 +402,37 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
alertaCtrlList.updateItem(alertaCtrl);
}
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.suscribirOK"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.INFORMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.suscribirOK"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
} catch (BusinessException ex) {
Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.ERROR);
Messagebox.show(ex.getLocalizedMessage(),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.ERROR);
} catch (Exception ex) {
log.error("editarAlertaCtrlController: " + ex, ex);
Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.ERROR);
Messagebox.show(Labels.getLabel("MSG.Error"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.ERROR);
}
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarPergunta"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.YES
| Messagebox.NO, Messagebox.QUESTION);
int resp = Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarPergunta"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
arlertaCtrlService.borrar(alertaCtrl);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarOK"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK,
Messagebox.INFORMATION);
Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarOK"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
alertaCtrlList.removeItem(alertaCtrl);
@ -482,7 +469,9 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
List<Corrida> lsCorrida = corridaService.buscarPorId(idCorrida);
if (lsCorrida.isEmpty()) {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} else {
alertaCtrl.setCorrida(lsCorrida.get(0));
horaCorrida.setValue(alertaCtrl.getCorrida().getFechorsalida());
@ -505,7 +494,9 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
List<Corrida> lsCorrida = corridaService.buscarFiltro(ori, des, hora, cs);
if (lsCorrida.isEmpty()) {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("editarAlertaCtrlController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} else {
alertaCtrl.setCorrida(lsCorrida.get(0));
horaCorrida.setValue(alertaCtrl.getCorrida().getFechorsalida());
@ -514,31 +505,6 @@ public class EditarAlertaCtrlController extends MyGenericForwardComposer impleme
cmbTipoServicio.setText(alertaCtrl.getCorrida().getClaseServicio().getDescclase());
}
}
// HibernateSearchObject<Corrida> corridaBusqueda =
// new HibernateSearchObject<Corrida>(Corrida.class,
// pagingCorrida.getPageSize());
// corridaBusqueda.addFilterEqual("activo", Boolean.TRUE);
//
// Date dataCorrida = fecCorrida.getValue();
// if (dataCorrida != null) {
// corridaBusqueda.addFilterEqual("id.feccorrida", dataCorrida);
// }
//
// Integer idCorrida = txtIdCorrida.getValue();
// if (idCorrida != null) {
// corridaBusqueda.addFilterEqual("id.corridaId", idCorrida);
// }
// plwCorrida.init(corridaBusqueda, corridaList, pagingCorrida);
// if (corridaList.getData().length == 0) {
// try {
// Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
// Labels.getLabel("editarAlertaCtrlController.window.title"),
// Messagebox.OK, Messagebox.INFORMATION);
// } catch (InterruptedException ex) {
// }
// }
}
public boolean noTraslapa() {

View File

@ -4,18 +4,9 @@
*/
package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
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.RenderEstacion;
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;
@ -32,105 +23,105 @@ import org.zkoss.zul.Longbox;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
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.RenderEstacion;
/**
*
*
* @author Administrador
*/
@Controller("busquedaEstacionController")
@Scope("prototype")
public class BusquedaEstacionController extends MyGenericForwardComposer {
@Autowired
private transient PagedListWrapper<Estacion> plwEstacion;
@Autowired
private PuntoVentaService puntoVentaService;
private List<PuntoVenta> lsPuntoVenta;
private MyListbox estacionList;
private Paging pagingEstacion;
private Textbox txtDescEstacion;
//private Textbox txtDescMac;
private Combobox cmbPuntoVenta;
private Longbox txtNumCaja;
private static Logger log = Logger.getLogger(BusquedaEstacionController.class);
private static final long serialVersionUID = 1L;
@Autowired
private transient PagedListWrapper<Estacion> plwEstacion;
private MyListbox estacionList;
private Paging pagingEstacion;
private Textbox txtDescEstacion;
private Combobox cmbPuntoVenta;
private Longbox txtNumCaja;
private static Logger log = Logger.getLogger(BusquedaEstacionController.class);
@Override
public void doAfterCompose(Component comp) throws Exception {
lsPuntoVenta = new ArrayList<PuntoVenta>();
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
super.doAfterCompose(comp);
estacionList.setItemRenderer(new RenderEstacion());
estacionList.addEventListener("onDoubleClick", new EventListener() {
estacionList.setItemRenderer(new RenderEstacion());
estacionList.addEventListener("onDoubleClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
Estacion s = (Estacion) estacionList.getSelected();
verEstacion(s);
}
});
@Override
public void onEvent(Event event) throws Exception {
Estacion s = (Estacion) estacionList.getSelected();
verEstacion(s);
}
});
refreshLista();
refreshLista();
txtDescEstacion.focus();
}
txtDescEstacion.focus();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void verEstacion(Estacion e) {
if (e == null) {
return;
}
private void verEstacion(Estacion e) {
if (e == null) {
return;
}
Map args = new HashMap();
args.put("estacion", e);
args.put("estacionList", estacionList);
Map args = new HashMap();
args.put("estacion", e);
args.put("estacionList", estacionList);
openWindow("/gui/seguridad/editarEstacion.zul",
Labels.getLabel("editarEstacionController.window.title"), args, MODAL);
}
openWindow("/gui/seguridad/editarEstacion.zul",
Labels.getLabel("editarEstacionController.window.title"), args, MODAL);
}
private void refreshLista() {
HibernateSearchObject<Estacion> estacionBusqueda =
new HibernateSearchObject<Estacion>(Estacion.class, pagingEstacion.getPageSize());
private void refreshLista() {
HibernateSearchObject<Estacion> estacionBusqueda =
new HibernateSearchObject<Estacion>(Estacion.class,
pagingEstacion.getPageSize());
estacionBusqueda.addFilterLike("descestacion", "%" + txtDescEstacion.getText().trim().concat("%"));
estacionBusqueda.addFilterLike("descestacion",
"%" + txtDescEstacion.getText().trim().concat("%"));
// estacionBusqueda.addFilterLike("descmac",
// "%" + txtDescMac.getText().trim().concat("%"));
Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem();
if (cbiPuntoVenta != null) {
PuntoVenta pv = (PuntoVenta) cbiPuntoVenta.getValue();
estacionBusqueda.addFilterEqual("puntoVenta", pv);
}
Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem();
if (cbiPuntoVenta != null) {
PuntoVenta pv = (PuntoVenta) cbiPuntoVenta.getValue();
estacionBusqueda.addFilterEqual("puntoVenta", pv);
}
estacionBusqueda.addFilterEqual("numcaja", txtNumCaja.getValue());
estacionBusqueda.addFilterEqual("numcaja", txtNumCaja.getValue());
estacionBusqueda.addSortAsc("descestacion");
estacionBusqueda.addFilterEqual("activo", Boolean.TRUE);
estacionBusqueda.addSortAsc("descestacion");
estacionBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwEstacion.init(estacionBusqueda, estacionList, pagingEstacion);
plwEstacion.init(estacionBusqueda, estacionList, pagingEstacion);
if (estacionList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
log.error(ex);
Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION);
}
}
}
if (estacionList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
log.error(ex);
Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION);
}
}
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnPesquisa(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnRefresh(Event ev) {
refreshLista();
}
public void onClick$btnNovo(Event ev) {
verEstacion(new Estacion());
}
public void onClick$btnNovo(Event ev) {
verEstacion(new Estacion());
}
}

View File

@ -4,19 +4,8 @@
*/
package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.entidad.UsuarioBancario;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.service.UsuarioBancarioService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
@ -28,13 +17,16 @@ import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Label;
import org.zkoss.zul.Longbox;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.EstacionService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
/**
*
* @author Administrador
@ -43,198 +35,100 @@ import org.zkoss.zul.Textbox;
@Scope("prototype")
public class EditarEstacionController extends MyGenericForwardComposer {
@Autowired
private EstacionService estacionService;
@Autowired
private UsuarioBancarioService usuarioBancarioService;
private MyListbox estacionList;
private Button btnApagar;
private Textbox txtDescEstacion;
private Textbox txtDescMac;
private Longbox txtNumCaja;
private Estacion estacion;
private List<PuntoVenta> lsPuntoVenta;
private List<UsuarioBancario> lsUsuarioBancario;
private MyComboboxPuntoVenta cmbPuntoVenta;
private Combobox cmbConexion;
private Checkbox chkPinPad;
private Label lbPinPad;
private static Logger log = Logger.getLogger(EditarEstacionController.class);
private static final long serialVersionUID = 1L;
@Autowired
private EstacionService estacionService;
private MyListbox estacionList;
private Button btnApagar;
private Textbox txtDescEstacion;
private Textbox txtDescMac;
private Estacion estacion;
private MyComboboxPuntoVenta cmbPuntoVenta;
private static Logger log = Logger.getLogger(EditarEstacionController.class);
public Button getBtnApagar() {
return btnApagar;
}
public Estacion getEstacion() {
return estacion;
}
public void setBtnApagar(Button btnApagar) {
this.btnApagar = btnApagar;
}
public void setEstacion(Estacion estacion) {
this.estacion = estacion;
}
public Estacion getEstacion() {
return estacion;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
public void setEstacion(Estacion estacion) {
this.estacion = estacion;
}
estacion = (Estacion) Executions.getCurrent().getArg().get("estacion");
estacionList = (MyListbox) Executions.getCurrent().getArg().get("estacionList");
public Textbox getTxtDescEstacion() {
return txtDescEstacion;
}
if (estacion.getEstacionId() == null) {
btnApagar.setVisible(Boolean.FALSE);
} else {
// Convertendo a mascara em Hexa novamente.
if (estacion.getDescmac() != null && !estacion.getDescmac().equals("")) {
Long hx = Long.parseLong(estacion.getDescmac(), 10);
String descMac = Long.toHexString(hx);
while (descMac.length() < 12) {
descMac = "0" + descMac;
}
// AABBCCDDEEFF
// AA-BB-CC-DD-EE-FF
descMac = descMac.substring(0, 2).concat("-").concat(descMac.substring(2, 4).concat("-")).concat(descMac.substring(4, 6)).concat("-").concat(descMac.substring(6, 8)).concat("-").concat(descMac.substring(8, 10).concat("-")).concat(descMac.substring(10, 12));
public void setTxtDescEstacion(Textbox txtDescEstacion) {
this.txtDescEstacion = txtDescEstacion;
}
txtDescMac.setText(descMac.toUpperCase());
}
}
public List<PuntoVenta> getLsPuntoVenta() {
return lsPuntoVenta;
}
txtDescEstacion.focus();
}
public void setLsPuntoVenta(List<PuntoVenta> lsPuntoVenta) {
this.lsPuntoVenta = lsPuntoVenta;
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
public Textbox getTxtDescMac() {
return txtDescMac;
}
cmbPuntoVenta.getValue(true);
public void setTxtDescMac(Textbox txtDescMac) {
this.txtDescMac = txtDescMac;
}
String descMac = txtDescMac.getText();
public Longbox getTxtNumCaja() {
return txtNumCaja;
}
estacion.setActivo(Boolean.TRUE);
estacion.setFecmodif(Calendar.getInstance().getTime());
estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString());
public void setTxtNumCaja(Longbox txtNumCaja) {
this.txtNumCaja = txtNumCaja;
}
try {
estacionService.suscribirActualizar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
public List<UsuarioBancario> getLsUsuarioBancario() {
return lsUsuarioBancario;
}
estacionList.updateItem(estacion);
public void setLsUsuarioBancario(List<UsuarioBancario> lsUsuarioBancario) {
this.lsUsuarioBancario = lsUsuarioBancario;
}
closeWindow();
} catch (BusinessException e) {
Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
}
}
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarPergunta"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
lsUsuarioBancario = usuarioBancarioService.obtenerTodos();
lsPuntoVenta = new ArrayList<PuntoVenta>();
if (resp == Messagebox.YES) {
estacionService.borrar(estacion);
estacion = (Estacion) Executions.getCurrent().getArg().get("estacion");
estacionList = (MyListbox) Executions.getCurrent().getArg().get("estacionList");
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarOK"),
Labels.getLabel("editarEstacionController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
lbPinPad.setVisible(Boolean.FALSE);
chkPinPad.setVisible(Boolean.FALSE);
estacionList.removeItem(estacion);
if (estacion.getEstacionId() == null) {
btnApagar.setVisible(Boolean.FALSE);
} else {
// Convertendo a mascara em Hexa novamente.
if (estacion.getDescmac() != null && !estacion.getDescmac().equals("")) {
Long hx = Long.parseLong(estacion.getDescmac(), 10);
String descMac = Long.toHexString(hx);
while (descMac.length() < 12) {
descMac = "0" + descMac;
}
// AABBCCDDEEFF
// AA-BB-CC-DD-EE-FF
descMac = descMac.substring(0, 2).concat("-").concat(descMac.substring(2, 4).concat("-")).concat(descMac.substring(4, 6)).concat("-").concat(descMac.substring(6, 8)).concat("-").concat(descMac.substring(8, 10).concat("-")).concat(descMac.substring(10, 12));
txtDescMac.setText(descMac.toUpperCase());
}
if (estacion.getConexionBancaria() != null) {
if (estacion.getConexionBancaria().equals("S")) {
lbPinPad.setVisible(Boolean.TRUE);
chkPinPad.setVisible(Boolean.TRUE);
if (estacion.getPinPadImpresoraPropia() != null) {
chkPinPad.setChecked(estacion.getPinPadImpresoraPropia());
}
}
}
}
txtDescEstacion.focus();
}
public void onClick$btnSalvar(Event ev) throws InterruptedException {
cmbPuntoVenta.getValue(true);
cmbConexion.getValue();
if (cmbConexion.getValue().equals("")) {
estacion.setConexionBancaria(null);
estacion.setUsuarioBancario(null);
}
String descMac = txtDescMac.getText();
estacion.setActivo(Boolean.TRUE);
estacion.setFecmodif(Calendar.getInstance().getTime());
estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString());
estacion.setPinPadImpresoraPropia(chkPinPad.isChecked());
try {
estacionService.suscribirActualizar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"),
Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
} catch (BusinessException e) {
Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION);
}
}
public void onClick$btnApagar(Event ev) {
try {
int resp = Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarPergunta"),
Labels.getLabel("editarEstacionController.window.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
if (resp == Messagebox.YES) {
estacionService.borrar(estacion);
Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarOK"),
Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.INFORMATION);
estacionList.removeItem(estacion);
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION);
}
}
public void onChange$cmbConexion(Event ev) {
habilitarCombo();
if (cmbConexion.getValue().equals("")) {
estacion.setConexionBancaria(null);
estacion.setUsuarioBancario(null);
}
}
private void habilitarCombo() {
Comboitem cbi = cmbConexion.getSelectedItem();
if (cbi != null) {
String valor = (String) cbi.getValue();
if (valor.equals("S")) {
lbPinPad.setVisible(Boolean.TRUE);
chkPinPad.setVisible(Boolean.TRUE);
} else {
lbPinPad.setVisible(Boolean.FALSE);
chkPinPad.setVisible(Boolean.FALSE);
chkPinPad.setChecked(Boolean.FALSE);
}
}
}
closeWindow();
}
} catch (Exception ex) {
log.error(ex);
Clients.alert(Labels.getLabel("MSG.Error"),
Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION);
}
}
}

View File

@ -7,7 +7,7 @@
# <controler>. <id>. <propiedade> = XXX
#Versao do VentaBoleto:
versao = ADM_20120820_1RC49
versao = ADM_20120821_1RC50
# MSG Defaut:
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100

View File

@ -5,73 +5,80 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winBusquedaEstacion" title="${c:l('busquedaEstacionController.window.title')}"
apply="${busquedaEstacionController}" contentStyle="overflow:auto"
height="500px" width="860px" border="normal" >
<window id="winBusquedaEstacion"
title="${c:l('busquedaEstacionController.window.title')}"
apply="${busquedaEstacionController}" contentStyle="overflow:auto"
height="500px" width="860px" border="normal">
<toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnNovo.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnCerrar" onClick="winBusquedaEstacion.detach()" image="/gui/img/exit.png" width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnCerrar.tooltiptext')}"/>
</toolbar>
<toolbar>
<button id="btnRefresh" image="/gui/img/refresh.png"
width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnRefresh.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnNovo" image="/gui/img/add.png" width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnNovo.tooltiptext')}" />
<separator orient="vertical" />
<button id="btnCerrar"
onClick="winBusquedaEstacion.detach()" image="/gui/img/exit.png"
width="35px"
tooltiptext="${c:l('busquedaEstacionController.btnCerrar.tooltiptext')}" />
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</columns>
<rows>
<row>
<label value="${c:l('busquedaEstacionController.lhDescEstacion.label')}"/>
<textbox id="txtDescEstacion" width="300px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" maxlength="60"/>
</row>
<!--row>
<label value="${c:l('busquedaEstacionController.lhDescMac.label')}"/>
<textbox id="txtDescMac" width="300px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
</row-->
<row>
<label value="${c:l('busquedaEstacionController.lhNumCaja.label')}"/>
<longbox id="txtNumCaja" width="300px" maxlength="10"/>
</row>
<row>
<label value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}"/>
<combobox id="cmbPuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
mold="rounded" buttonVisible="true" width="300px"/>
</row>
</rows>
</grid>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</columns>
<rows>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" />
<textbox id="txtDescEstacion" width="300px"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
maxlength="60" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" />
<longbox id="txtNumCaja" width="300px"
maxlength="10" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" />
<combobox id="cmbPuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
mold="rounded" buttonVisible="true" width="300px" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaEstacionController.btnPesquisa.label')}"/>
</toolbar>
<toolbar>
<button id="btnPesquisa" image="/gui/img/find.png"
label="${c:l('busquedaEstacionController.btnPesquisa.label')}" />
</toolbar>
<paging id="pagingEstacion" pageSize="15" />
<listbox id="estacionList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
multiple="false" height="55%">
<listhead sizable="true">
<listheader image="/gui/img/create_doc.gif" width="50px"
label="${c:l('busquedaEstacionController.ID.label')}"
sort="auto(estacionId)"/>
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhDescEstacion.label')}"
sort="auto(descestacion)"/>
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhDescMac.label')}"
sort="auto(descmac)"/>
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhNumCaja.label')}"
sort="auto(numcaja)"/>
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhPuntoVenta.label')}"
sort="auto(puntoVenta.nombpuntoventa)"/>
</listhead>
</listbox>
</window>
<paging id="pagingEstacion" pageSize="15" />
<listbox id="estacionList"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
multiple="false" height="55%">
<listhead sizable="true">
<listheader image="/gui/img/create_doc.gif" width="50px"
label="${c:l('busquedaEstacionController.ID.label')}"
sort="auto(estacionId)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhDescEstacion.label')}"
sort="auto(descestacion)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhDescMac.label')}"
sort="auto(descmac)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhNumCaja.label')}"
sort="auto(numcaja)" />
<listheader image="/gui/img/create_doc.gif"
label="${c:l('busquedaEstacionController.lhPuntoVenta.label')}"
sort="auto(puntoVenta.nombpuntoventa)" />
</listhead>
</listbox>
</window>
</zk>

View File

@ -5,71 +5,64 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winEditarEstacion" border="normal" apply="${editarEstacionController}"
width="500px" height="300px" contentStyle="overflow:auto"
title="${c:l('editarEstacionController.window.title')}">
<toolbar>
<hbox spacing="5px" style="padding:1px" align="right">
<button id="btnApagar" height="20"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarEstacionController.btnApagar.tooltiptext')}"/>
<button id="btnSalvar" height="20"
image="/gui/img/save.png" width="35px"
tooltiptext="${c:l('editarEstacionController.btnSalvar.tooltiptext')}"/>
<button id="btnFechar" height="20"
image="/gui/img/exit.png" width="35px"
onClick="winEditarEstacion.detach()"
tooltiptext="${c:l('editarEstacionController.btnFechar.tooltiptext')}"/>
</hbox>
</toolbar>
<window id="winEditarEstacion" border="normal"
apply="${editarEstacionController}" width="500px" height="300px"
contentStyle="overflow:auto"
title="${c:l('editarEstacionController.window.title')}">
<toolbar>
<hbox spacing="5px" style="padding:1px" align="right">
<button id="btnApagar" height="20"
image="/gui/img/remove.png" width="35px"
tooltiptext="${c:l('editarEstacionController.btnApagar.tooltiptext')}" />
<button id="btnSalvar" height="20"
image="/gui/img/save.png" width="35px"
tooltiptext="${c:l('editarEstacionController.btnSalvar.tooltiptext')}" />
<button id="btnFechar" height="20"
image="/gui/img/exit.png" width="35px"
onClick="winEditarEstacion.detach()"
tooltiptext="${c:l('editarEstacionController.btnFechar.tooltiptext')}" />
</hbox>
</toolbar>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</columns>
<rows>
<row>
<label value="${c:l('busquedaEstacionController.lhDescEstacion.label')}"/>
<textbox id="txtDescEstacion" width="90%" rows="3"
constraint="no empty" maxlength="60"
value="@{winEditarEstacion$composer.estacion.descestacion}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
</row>
<row>
<label value="${c:l('busquedaEstacionController.lhDescMac.label')}"/>
<textbox id="txtDescMac" width="90%"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}" maxlength="17"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
</row>
<row>
<label value="${c:l('busquedaEstacionController.lhNumCaja.label')}"/>
<longbox id="txtNumCaja" width="90%" constraint="no empty" maxlength="10"
value="@{winEditarEstacion$composer.estacion.numcaja}"/>
</row>
<row>
<label value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}"/>
<combobox id="cmbPuntoVenta" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}"
selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}"
mold="rounded" buttonVisible="true" width="90%" />
</row>
<row>
<label value="${c:l('editarEstacionController.conexion')}"/>
<combobox id="cmbConexion" width="90%" mold="rounded" buttonVisible="true" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
selectedItem="@{winEditarEstacion$composer.estacion.conexionBancaria}">
<!--comboitem value="B" label="${c:l('editarEstacionController.IndTipo.1')}" /-->
<comboitem value="M" label="${c:l('editarEstacionController.IndTipo.2')}" />
<comboitem value="S" label="${c:l('editarEstacionController.IndTipo.3')}" />
</combobox>
</row>
<row>
<label id="lbPinPad" value="${c:l('editarEstacionController.pinPad')}"/>
<checkbox id="chkPinPad" />
</row>
</rows>
</grid>
</window>
<grid fixedLayout="true">
<columns>
<column width="40%" />
<column width="60%" />
</columns>
<rows>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescEstacion.label')}" />
<textbox id="txtDescEstacion" width="90%" rows="3"
constraint="no empty" maxlength="60"
value="@{winEditarEstacion$composer.estacion.descestacion}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhDescMac.label')}" />
<textbox id="txtDescMac" width="90%"
constraint="${c:new('com.rjconsultores.ventaboletos.web.utilerias.MACConstraint')}"
maxlength="17"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhNumCaja.label')}" />
<longbox id="txtNumCaja" width="90%"
constraint="no empty" maxlength="10"
value="@{winEditarEstacion$composer.estacion.numcaja}" />
</row>
<row>
<label
value="${c:l('busquedaEstacionController.lhPuntoVenta.label')}" />
<combobox id="cmbPuntoVenta" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
initialValue="@{winEditarEstacion$composer.estacion.puntoVenta}"
selectedItem="@{winEditarEstacion$composer.estacion.puntoVenta}"
mold="rounded" buttonVisible="true" width="90%" />
</row>
</rows>
</grid>
</window>
</zk>