Package Controle

Source Code of Controle.ControleRelatorio

package Controle;

import DAO.RelatoriosDao;
import Entidade.RelatoDeMelhoria;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;

@ManagedBean
@ViewScoped
public class ControleRelatorio implements Serializable {

    private List<RelatoDeMelhoria> itens;
    private Date dataInicial = new Date();
    private Date dataFinal = new Date();
    private Integer tipoRelatorio;
    private boolean renderRmps = false;
    private boolean renderPlans = false;

    public Date getDataInicial() {
        return dataInicial;
    }

    public void setDataInicial(Date dataInicial) {
        this.dataInicial = dataInicial;
    }

    public boolean isRenderRmps() {
        return renderRmps;
    }

    public void setRenderRmps(boolean renderRmps) {
        this.renderRmps = renderRmps;
    }

    public boolean isRenderPlans() {
        return renderPlans;
    }

    public void setRenderPlans(boolean renderPlans) {
        this.renderPlans = renderPlans;
    }

    public Date getDataFinal() {
        return dataFinal;
    }

    public void setDataFinal(Date dataFinal) {
        this.dataFinal = dataFinal;
    }

    public Integer getTipoRelatorio() {
        return tipoRelatorio;
    }

    public void setTipoRelatorio(Integer tipoRelatorio) {
        this.tipoRelatorio = tipoRelatorio;
    }

    public List<RelatoDeMelhoria> getItens() {
        return itens;
    }

    public void setItens(List<RelatoDeMelhoria> itens) {
        this.itens = itens;
    }

    public List<RelatoDeMelhoria> buscarRelatorio() {
        if (tipoRelatorio == 1) {
            itens = new RelatoriosDao().listarRmpsPorStatus(this.dataInicial, this.dataFinal);
            this.renderRmps = true;
            this.renderPlans = false;
        } else {
            if (tipoRelatorio == 2) {
                this.renderRmps = false;
                this.renderPlans = true;
            }
        }
        return itens;
    }
}
TOP

Related Classes of Controle.ControleRelatorio

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.