public ActionResult Edit(int id) { KlantenRepository kr = new KlantenRepository(); ViewBag.ProvincieList = new SelectList(kr.GetProvincieList(), "Id", "ProvincieName"); ViewBag.ObserveerList = new SelectList(kr.GetObserveerList(), "Id", "ObserverenName"); ViewBag.WeghaalList = new SelectList(kr.GetWeghaalList(), "Id", "WeghaalName"); return(View(kr.GetKlantByIdEdit(id))); }
public ActionResult Create() { Klanten klant = new Klanten(); KlantenRepository kr = new KlantenRepository(); //Viewbags for the dropdownlists ViewBag.ProvincieList = new SelectList(kr.GetProvincieList(), "Id", "ProvincieName"); ViewBag.ObserveerList = new SelectList(kr.GetObserveerList(), "Id", "ObserverenName"); ViewBag.WeghaalList = new SelectList(kr.GetWeghaalList(), "Id", "WeghaalName"); return(View(klant)); }