Beispiel #1
0
        /// <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());
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }