/// <summary> /// Retourne le nombre d'absences d'un élève /// </summary> /// <param name="eleveId">Identifiant de l'élève</param> /// <returns></returns> public int GetNbAbsencesByEleveId(int eleveId) { AbsenceQuery query = new AbsenceQuery(monContexte); List <Absence> result = query.GetByEleveId(eleveId); return(result.Count()); }
/// <summary> /// Retourne les absences correspondant à un élève /// </summary> /// <param name="eleveId">Identifiant de l'élève</param> /// <returns>Liste d'entités <see cref="Absence"/></returns> public List <Absence> GetAbsencesByEleveId(int eleveId) { AbsenceQuery query = new AbsenceQuery(monContexte); List <Absence> result = query.GetByEleveId(eleveId); return(result); }
public Eleve GetOneEleve(int id) { EleveQuery eq = new EleveQuery(context); Eleve e = eq.GetOne(id); NoteQuery nq = new NoteQuery(context); e.Notes = nq.GetByEleveId(id).ToList(); AbsenceQuery aq = new AbsenceQuery(context); e.Absences = aq.GetByEleveId(id).ToList(); return(e); }
public List <Eleve> GetAllEleve() { EleveQuery eq = new EleveQuery(context); List <Eleve> eleves = new List <Eleve>(); foreach (Eleve e in eq.GetAll().ToList()) { NoteQuery nq = new NoteQuery(context); e.Notes = nq.GetByEleveId(e.Id).ToList(); AbsenceQuery aq = new AbsenceQuery(context); e.Absences = aq.GetByEleveId(e.Id).ToList(); eleves.Add(e); } return(eleves); }