public ActionResult DernierResultats(int id) { ResultsViewModel resultats = new ResultsViewModel(); Audit currentaudit = ServiceAudit.getlatestAuditforZone(id); resultats.audit = currentaudit; resultats.themes = ServiceTheme.GetAllThemeswithoutdetaching(currentaudit); resultats.resultats = ServiceResultat.getAuditresults(currentaudit); return(View(resultats)); }
static List <ZoneWithLevel> descStars(List <Zone> zones) { Audit audit; List <ZoneWithLevel> ZWL = new List <ZoneWithLevel>(); foreach (var item in zones) { audit = ServiceAudit.getlatestAuditforZone(item.ZoneId); if (audit != null) { ZWL.Add(new ZoneWithLevel { zone = item, level = audit.FiveStarsLevel }); } } return(ZWL.OrderByDescending(z => z.level).ToList()); }
static List <ZoneWithProgress> ascProgress(List <Zone> zones) { Audit latestaudit; Audit beforelatestaudit; List <ZoneWithProgress> ZWP = new List <ZoneWithProgress>(); foreach (var item in zones) { latestaudit = ServiceAudit.getlatestAuditforZone(item.ZoneId); beforelatestaudit = ServiceAudit.getbeforelatestAuditforZone(item.ZoneId); if (beforelatestaudit != null) { ZWP.Add(new ZoneWithProgress { zone = item, progress = latestaudit.Note - beforelatestaudit.Note }); } } return(ZWP.OrderBy(z => z.progress).ToList()); }
static List <ZoneWithNote> descNotes(List <Zone> zones) { Audit audit; int pointcount = ServicePoint.GetAllPoints().Count; List <ZoneWithNote> ZWN = new List <ZoneWithNote>(); foreach (var item in zones) { audit = ServiceAudit.getlatestAuditforZone(item.ZoneId); if (audit != null) { ZWN.Add(new ZoneWithNote { zone = item, note = audit.Note, pointcount = pointcount }); } } return(ZWN.OrderByDescending(z => z.note).ToList()); }