public ActionResult Edit(string naam, string schooljaar, string opleidingsNaam, string opleidingsSchooljaar) { if (naam == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var faseTypes = _unitOfWork.GetRepository <FaseType>().GetAll().ToList(); var fase = _unitOfWork.GetRepository <Fase>().GetOne(new object[] { naam, schooljaar, opleidingsNaam, opleidingsSchooljaar }); if (fase == null) { return(HttpNotFound()); } var faseVM = new FaseCrudViewModel() { FaseType = Mapper.Map <FaseType, FaseTypeViewModel>(fase.FaseType1), Naam = fase.Naam, Beschrijving = fase.Beschrijving, FaseTypes = faseTypes.Select(Mapper.Map <FaseType, FaseTypeViewModel>).ToList() }; return(PartialView("~/Views/Admin/Curriculum/Fase/_Edit.cshtml", faseVM)); }
public ActionResult Create() { var faseTypes = _unitOfWork.GetRepository <FaseType>().GetAll().ToList(); var fase = new FaseCrudViewModel() { FaseTypes = faseTypes.Select(Mapper.Map <FaseType, FaseTypeViewModel>).ToList() }; return(PartialView("~/Views/Admin/Curriculum/Fase/_Add.cshtml", fase)); }