using projet.dal;
using projet.modele;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace projet.Controller
{
    internal class GestionAbsenceController
    {
        private readonly AbsenceAccess absenceAccess;
        private readonly PersonnelAccess personnelAccess;
        private readonly MotifAccess motifAccess;

        public GestionAbsenceController()
        {
            absenceAccess = new AbsenceAccess();
            personnelAccess = new PersonnelAccess();
            motifAccess = new MotifAccess();
        }

        public List<Absence> GetAbsences(Personnel personnel)
        {
            return absenceAccess.GetAbsences(personnel);
        }

        public List<Motif> GetAllMotifs()
        {
            return motifAccess.GetAllMotifs();
        }

        public void AddAbsence(Absence absence, Personnel personne)
        {
            absenceAccess.AddAbsence(absence, personne);
        }

        public void DeleteAbsence(Absence absence)
        {
            absenceAccess.DeleteAbsence(absence);
        }

        public int GetMotifIdByLibelle(string libelle)
        {
            return motifAccess.GetMotifIdByLibelle(libelle);
        }
    }
}
