Пример #1
0
        /// <summary>
        /// Retourne tous les élèves
        /// </summary>
        /// <param name="criterias">critères de recherche</param>
        /// <returns>Liste d'entités <see cref="Eleve"/></returns>
        public List <Eleve> GetAllEleves(String criterias)
        {
            EleveQuery   query  = new EleveQuery(monContexte);
            List <Eleve> result = query.GetAll(criterias);

            return(result);
        }
Пример #2
0
        public List <Eleve> GetEleves()
        {
            EleveQuery query  = new EleveQuery(_contexte);
            var        result = query.GetAll();

            return(result);
        }
Пример #3
0
        public ListEleveVM()
        {
            _eleves = new ObservableCollection <DetailEleveVM>();
            query   = new EleveQuery(_context);
            query.GetAll().ToList().ForEach(e => _eleves.Add(new DetailEleveVM(e)));

            if (_eleves != null && _eleves.Count > 0)
            {
                _selectedEleve = _eleves.ElementAt(0);
            }
        }
        // GET: EleveAg
        public JsonResult Index()
        {
            var eleves = eleveQuery.GetAll().ToList();

            foreach (Eleve e in eleves)
            {
                e.Classe.Eleves = null;
            }


            return(Json(JsonConvert.SerializeObject(eleves, Formatting.Indented, new JsonSerializerSettings {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            }), JsonRequestBehavior.AllowGet));
        }
Пример #5
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);
        }
Пример #6
0
        public ListEleveViewModel()
        {
            Context      c  = new Context();
            EleveQuery   eq = new EleveQuery(c);
            List <Eleve> le = eq.GetAll().ToList();

            _eleves = new ObservableCollection <DetailEleveViewModel>();
            foreach (Eleve e in le)
            {
                _eleves.Add(new DetailEleveViewModel(e));
            }
            if (_eleves != null && _eleves.Count > 0)
            {
                _selectedEleve = _eleves.ElementAt(0);
            }
        }
Пример #7
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);
        }
Пример #8
0
        public JsonResult GetBestEleves()
        {
            var eleves = eleveQuery.GetAll().ToList();

            var elevesSorted = (from e in eleves
                                where e.Notes.Count > 0
                                orderby e.Notes.Average(n => n.NoteValue) descending
                                select e).Take(5).ToList();


            foreach (Eleve e in elevesSorted)
            {
                e.Classe.Eleves = null;
            }

            return(Json(JsonConvert.SerializeObject(elevesSorted, Formatting.Indented, new JsonSerializerSettings
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            }), JsonRequestBehavior.AllowGet));
        }
Пример #9
0
        /// <summary>
        /// Récupérer une liste d'élève en base
        /// </summary>
        /// <returns>Liste de Eleve</returns>
        public List <Eleve> GetAllEleve()
        {
            EleveQuery eq = new EleveQuery(contexte);

            return(eq.GetAll().ToList());
        }