/// <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); }
public List <Eleve> GetEleves() { EleveQuery query = new EleveQuery(_contexte); var result = query.GetAll(); return(result); }
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)); }
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); }
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); } }
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); }
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)); }
/// <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()); }