/*
 * 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.horario.Services;

import java.util.ArrayList;
import pe.siso.horario.Beans.Modulo;
import pe.siso.horario.DAO.DAOFactory;
import pe.siso.horario.DAO.ModuloDAO;

/**
 *
 * @author fcelestino
 */
public class ModuloServices {
    DAOFactory fabrica = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
    ModuloDAO objModuloDAO= fabrica.getModuloDAO();
    
    public ArrayList<Modulo> listarModulo(int codigoNivel){
        ArrayList<Modulo> lista=null;
         try {
            lista = objModuloDAO.listarModulo(codigoNivel);  
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
	return lista;
    }
    
    public ArrayList<Modulo> listarModuloDocente(int codigoNivel){
        ArrayList<Modulo> lista=null;
         try {
            lista = objModuloDAO.listarModuloDocente(codigoNivel);  
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
	return lista;
    }
    
    public ArrayList<Modulo> listarModulo(){
        ArrayList<Modulo> lista=null;
         try {
            lista = objModuloDAO.listarModulo();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
	return lista;
    }
}
