public ActionResult Barometer(int report_id = 0) { BaroReportWrapper viewModel = db.ProjectReportDates .Where(r => r.id == report_id) .Select(r => new BaroReportWrapper { ReportDate = r, Project = r.Project, Aspects = r.Project.BaroTemplate.BaroAspects.Where(a => a.is_head_aspect == 1).ToList() }).FirstOrDefault(); if (viewModel == null) { return(HttpNotFound()); } ProjectGroup group = daoStudent.getStudentGroup(curUser.Studentnummer).First(); if (group == null) { return(RedirectToAction("Dashboard")); } viewModel.ReporterId = curUser.StudentId; viewModel.Members = daoProject.getUsersInGroup(group.id).ToList(); return(View(viewModel)); }
/// <summary> /// Verkrijg barometer invul form /// </summary> /// <returns></returns> public ActionResult Create(int reporter_id = 0, int subject_id = 0, int project_report_date_id = 0) { BaroReportWrapper viewModel = _db.ProjectReportDates .Where(r => r.id == project_report_date_id) .Select(r => new BaroReportWrapper { ReportDate = r, Project = r.Project, Aspects = r.Project.BaroTemplate.BaroAspects.Where(a => a.is_head_aspect == 1).ToList() }).FirstOrDefault(); ViewBag.reporter_id = reporter_id; ViewBag.subject_id = subject_id; return(PartialView("_BaroFormPartial", viewModel)); }