/*
 * 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.PricingEspecifico;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;

import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import org.zkoss.zul.Listcell;

/**
 * 
 * @author Cássio Rocha
 */
public class RenderPricingEspecifico implements ListitemRenderer {

	public void render(Listitem lstm, Object o) throws Exception {
		PricingEspecifico pe = (PricingEspecifico) o;

		Listcell lc = new Listcell(pe.getPricingespecificoId().toString());
		lc.setParent(lstm);

		lc = new Listcell(pe.getNombPricing() == null ? "" : pe.getNombPricing());
		lc.setParent(lstm);

		lc = new Listcell(pe.getMarca().getDescmarca());
		lc.setParent(lstm);

		lc = new Listcell(pe.getMoneda().getDescmoneda());
		lc.setParent(lstm);

		lc = new Listcell(pe.getCategoria().getDesccategoria());
		lc.setParent(lstm);

		lc = new Listcell(pe.getClaseServicio().getDescclase());
		lc.setParent(lstm);

		lc = new Listcell(DateUtil.getStringDate(pe.getFechorinicio(), "dd/MM/yyyy HH:mm"));
		lc.setParent(lstm);

		lc = new Listcell(DateUtil.getStringDate(pe.getFechorfin(), "dd/MM/yyyy HH:mm"));
		lc.setParent(lstm);

		Integer corridaId = pe.getCorridaId();
		if (corridaId != null) {
			lc = new Listcell(corridaId.toString());
		} else {
			lc = new Listcell("");
		}
		lc.setParent(lstm);

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