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

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

import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca;
import com.rjconsultores.ventaboletos.entidad.PricingMarca;

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

    public void render(Listitem lstm, Object o) throws Exception {
    	if(o instanceof PricingMarca) {
	    	PricingMarca pm = (PricingMarca) o;
	
	        Listcell lc = new Listcell();
	
	        if (pm.getMarca() != null) {
	            lc = new Listcell(pm.getMarca().getDescmarca());
	        } else {
	            lc = new Listcell("-");
	        }
	        lc.setParent(lstm);
	
	        lstm.setAttribute("data", pm);
    	} else {
    		GP_PricingMarca pm = (GP_PricingMarca) o;
    		
	        Listcell lc = new Listcell();
	
	        if (pm.getMarca() != null) {
	            lc = new Listcell(pm.getMarca().getDescmarca());
	        } else {
	            lc = new Listcell("-");
	        }
	        lc.setParent(lstm);
	
	        lstm.setAttribute("data", pm);
    	}
    }
}
