/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.siso.asistenciaAniversario.Services;

import java.util.ArrayList;
import pe.siso.asistenciaAniversario.Beans.Conteo;
import pe.siso.asistenciaAniversario.DAO.ConteoDAO;
import pe.siso.asistenciaAniversario.DAO.DAOFactory;

/**
 *
 * @author sistem13user
 */
public class ConteoServices {
 
    DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
    ConteoDAO objConteoDAO = fabrica.getConteoDAO();
    
    public int registrarTicket(String tipo){
        int dato = 0;
        try {
            dato = objConteoDAO.registrarTicket(tipo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dato;
    }
    
    public String consultarEntradas(){
        String dato = "";
        try {
            dato = objConteoDAO.consultarEntradas();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dato;
    }
    
    public int totalTicket(){
        int dato = 0;
        try {
            dato = objConteoDAO.totalTicket();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dato;
    }
    
    public ArrayList<Conteo> consultarTotalEntradasPorTipo(){
        ArrayList<Conteo> lista = new ArrayList<Conteo>();
        try {
            lista = objConteoDAO.consultarTotalEntradasPorTipo();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return lista;
    }
    
    
    
}
