/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.web.utilerias.render;

import com.rjconsultores.ventaboletos.entidad.PricingMercado;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

/**
 *
 * @author Rafius
 */
public class RenderPricingMercado implements ListitemRenderer {

    public void render(Listitem lstm, Object o) throws Exception {
        PricingMercado pm = (PricingMercado) o;

        Listcell lc = new Listcell();

        if (pm.getOrigen() != null) {
            lc = new Listcell(pm.getOrigen().getCveparada());
        } else {
            lc = new Listcell("-");
        }
        lc.setParent(lstm);

        if (pm.getOrigen() != null) {
            lc = new Listcell(pm.getOrigen().getDescparada());
        } else {
            lc = new Listcell("-");
        }
        lc.setParent(lstm);

        if (pm.getDestino() != null) {
            lc = new Listcell(pm.getDestino().getCveparada());
        } else {
            lc = new Listcell("-");
        }

        lc.setParent(lstm);
        if (pm.getDestino() != null) {
            lc = new Listcell(pm.getDestino().getDescparada());
        } else {
            lc = new Listcell("-");
        }
        lc.setParent(lstm);

        lstm.setAttribute("data", pm);
    }
}
