valdevir 2017-08-25 21:25:03 +00:00
parent 590cf8061c
commit 53777f95cd
1 changed files with 15 additions and 4 deletions

View File

@ -4,24 +4,35 @@
*/ */
package com.rjconsultores.ventaboletos.web.utilerias.render; package com.rjconsultores.ventaboletos.web.utilerias.render;
import com.rjconsultores.ventaboletos.entidad.PricingRuta;
import org.zkoss.zul.Listcell; import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer; import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.PricingRuta;
/** /**
* *
* @author Rafius * @author Rafius
*/ */
public class RenderPricingRuta implements ListitemRenderer { public class RenderPricingRuta implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception { @Override
public void render(Listitem lstm, Object o) throws Exception {
PricingRuta pc = (PricingRuta) o; PricingRuta pc = (PricingRuta) o;
Listcell lc = new Listcell(); Listcell lc = new Listcell();
if (pc.getRuta() != null) { if (pc.getRuta() != null && pc.getRuta().getRutaId() != null) {
lc = new Listcell(pc.getRuta().getRutaId().toString() + " - " + pc.getRuta().getDescruta() + " - " + pc.getRuta().getPrefixo() ); String descLinha = "";
if (pc.getRuta().getRutaId() != -1) {
String sentido = pc.getRuta().getIndSentidoIda() == null || Boolean.TRUE.equals(pc.getRuta().getIndSentidoIda()) ? "IDA" : "VOLTA";
String descClasse = pc.getRuta().getClaseServicio() != null ? pc.getRuta().getClaseServicio().getDescclase() : "null";
descLinha = pc.getRuta().getNumRuta() + " - " + pc.getRuta().getDescruta() + " - "
+ pc.getRuta().getRutaId().toString() + " - " + descClasse + " - " + sentido;
} else {
descLinha = pc.getRuta().getDescruta();
}
lc = new Listcell(descLinha);
} else { } else {
lc = new Listcell("-"); lc = new Listcell("-");
} }