예제 #1
0
        /// <summary>
        /// Retourne les notes correspondant à un élève
        /// </summary>
        /// <param name="eleveId">Identifiant de l'élève</param>
        /// <returns>Liste d'entités <see cref="Note"/></returns>
        public List <Note> GetNotesByEleveId(int eleveId)
        {
            NoteQuery   query  = new NoteQuery(monContexte);
            List <Note> result = query.GetByEleveId(eleveId);

            return(result);
        }
예제 #2
0
        /// <summary>
        /// Permet d'obtenir la moyenne de l'élève
        /// </summary>
        /// <param name="eleveId">Identifiant de l'élève</param>
        /// <returns></returns>
        public double GetAverageByEleveId(int eleveId)
        {
            NoteQuery   query  = new NoteQuery(monContexte);
            List <Note> result = query.GetByEleveId(eleveId);

            if (result.Count() == 0)
            {
                return(0);
            }

            return(result.Average(n => n.ValeurNote));
        }
예제 #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);
        }
예제 #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);
        }