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.PtoVtaSeguro;

public class RenderPtoVtaSeguro implements ListitemRenderer {

	public void render(Listitem lstm, Object o) throws Exception {
		PtoVtaSeguro pto = (PtoVtaSeguro) o;

		Listcell lc = new Listcell(pto.getEmpresa().getNombempresa());
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndVendeSegOpcional()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndEstanSegOpcional()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndVendeSegTabela()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndEstanSegTabela()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndEstanTasaEmbarque()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndPermisoTasaEmbarque()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndPermisoTasaEmbarqueVtaManual()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndPermisoTasaEmbarqueVtaAgencia()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndVendeSeguroOpcEmbarcada()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndVendeSeguroTabelaEmbarcada()));
		lc.setParent(lstm);

		lc = new Listcell(getValue(pto.getIndTaxaEmbarqueEmbarcada()));
		lc.setParent(lstm);
		
		lc = new Listcell(getValue(pto.getIndVendeAsistenciaDeViaje()));
		lc.setParent(lstm);
		
		lc = new Listcell(getValue(pto.getIndEstanAsistenciaDeViaje()));
		lc.setParent(lstm);
		
		lstm.setAttribute("data", pto);

	}

	private String getValue(Boolean bol) {
		return Boolean.TRUE.equals(bol) ? Labels.getLabel("MSG.SI") : Labels.getLabel("MSG.NO");
	}
}
