public ActionResult Create([Bind(Include = "Id,BoekingStart,Kortingspercentage")] Boeking boeking) { if (ModelState.IsValid) { db.CreateBoeking(boeking); return(RedirectToAction("Index")); } return(View(boeking)); }
public ActionResult Afgerond(BoekingKortingVM b, string[] guestname, string[] postalcode, int[] housenumber, char[] housenumberaddition, string[] email) { b.Boeking.Kamer = db.GetKamerForId(b.Boeking.Kamer.Id); b.Boeking.KamerID = b.Boeking.Kamer.Id; b.Boeking.Gasten = new List <Gast>(); for (int i = 0; i < guestname.Length; i++) { Gast gast = new Gast(); gast.EMail = email[i]; gast.Huisnummer = housenumber[i]; gast.Naam = guestname[i]; gast.Postcode = postalcode[i]; gast.Toevoeging = housenumberaddition[i]; b.Boeking.Gasten.Add(gast); } db.CreateBoeking(b.Boeking); return(View()); }