package com.rjconsultores.ventaboletos.web.utilerias.render;

import org.zkoss.util.resource.Labels;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

import com.rjconsultores.ventaboletos.entidad.OrgaoEmpParam;;

public class RenderOrgaoEmpParam implements ListitemRenderer {

	@Override
	public void render(Listitem arg0, Object arg1) throws Exception {
		OrgaoEmpParam orgaoEmpParam = (OrgaoEmpParam) arg1;

		Listcell lc = new Listcell(orgaoEmpParam.getEmpresa().getNombempresa());
		lc.setParent(arg0);

		lc = new Listcell(orgaoEmpParam.getIndemitesegundavia() != null && orgaoEmpParam.getIndemitesegundavia() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO"));
		lc.setParent(arg0);

		lc = new Listcell(orgaoEmpParam.getInddoiscupomembarque() != null && orgaoEmpParam.getInddoiscupomembarque() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO"));
		lc.setParent(arg0);
		
		lc = new Listcell(orgaoEmpParam.getCodEmpresaPorOrgao());
		lc.setParent(arg0);
		
		lc = new Listcell(orgaoEmpParam.getIndNaoRestringe2ViaBPe() != null && orgaoEmpParam.getIndNaoRestringe2ViaBPe() ? "NÃO RESTRINGE" : "RESTRINGE");
		lc.setParent(arg0);		
		
		lc = orgaoEmpParam.getIndiceExcessoDeBagagem()!= null? new Listcell(orgaoEmpParam.getIndiceExcessoDeBagagem().toString().replace(".", ",")):new Listcell("");
		lc.setParent(arg0);
		
		lc = orgaoEmpParam.getPesoExcessoDeBagagemFranquia()!= null? new Listcell(orgaoEmpParam.getPesoExcessoDeBagagemFranquia().toString()):new Listcell("");
		lc.setParent(arg0);
		
		lc = orgaoEmpParam.getPesoExtraExcessoDeBagagem()!= null? new Listcell(orgaoEmpParam.getPesoExtraExcessoDeBagagem().toString()):new Listcell("");
		lc.setParent(arg0);
		
		lc = new Listcell(orgaoEmpParam.getChkIndEmite2ViaAposSaida() ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO"));
		lc.setParent(arg0);
		
		

		arg0.setAttribute("data", orgaoEmpParam);
	}

}
