示例#1
0
        public List <Note> getNotesByEleveId(int id)
        {
            NoteQuerry  nq    = new NoteQuerry(contexte);
            List <Note> notes = new List <Note>();

            foreach (Note n in nq.GetAllByEleveId(id))
            {
                notes.Add(n);
            }
            return(notes);
        }
示例#2
0
        public Eleve getOneEleveById(int id)
        {
            EleveQuery    eq = new EleveQuery(contexte);
            NoteQuerry    nq = new NoteQuerry(contexte);
            AbsenceQuerry aq = new AbsenceQuerry(contexte);
            Eleve         e  = eq.GetOne(id);

            e.Notes = nq.GetAllByEleveId(e.Id).ToList() != null?nq.GetAllByEleveId(e.Id).ToList() : new List <Note>();

            e.GetMoyenne();
            e.Absences = aq.GetAllByEleveId(e.Id).ToList() != null?aq.GetAllByEleveId(e.Id).ToList() : new List <Absence>();

            return(e);
        }
示例#3
0
        public List <Eleve> getEleveByClasseId(int id)
        {
            EleveQuery    eq     = new EleveQuery(contexte);
            NoteQuerry    nq     = new NoteQuerry(contexte);
            AbsenceQuerry aq     = new AbsenceQuerry(contexte);
            List <Eleve>  eleves = eq.getByClassId(id);

            foreach (Eleve e in eleves)
            {
                e.Notes = nq.GetAllByEleveId(e.Id).ToList() != null?nq.GetAllByEleveId(e.Id).ToList() : new List <Note>();

                e.Absences = aq.GetAllByEleveId(e.Id).ToList() != null?aq.GetAllByEleveId(e.Id).ToList() : new List <Absence>();
            }
            return(eleves);
        }
示例#4
0
        public List <Eleve> GetAllEleve()
        {
            EleveQuery    eq     = new EleveQuery(contexte);
            List <Eleve>  eleves = new List <Eleve>();
            NoteQuerry    nq     = new NoteQuerry(contexte);
            AbsenceQuerry aq     = new AbsenceQuerry(contexte);

            foreach (Eleve e in eq.GetAll().ToList())
            {
                List <Note> notes = new List <Note>();
                notes   = nq.GetAllByEleveId(e.Id).ToList();
                e.Notes = notes != null ? notes : new List <Note>();
                e.GetMoyenne();
                List <Absence> absences = new List <Absence>();
                absences   = aq.GetAllByEleveId(e.Id).ToList();
                e.Absences = absences != null ? absences : new List <Absence>();
                eleves.Add(e);
            }
            return(eleves);
        }