Пример #1
0
        // GET: Reserveer/Plaats
        public ActionResult Plaats()
        {
            if (Session["event"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            ReserveringViewModel  reservering = (ReserveringViewModel)Session["reservering"];
            StandplaatsRepository repo        = new StandplaatsRepository(new StandplaatsContext());

            ViewData["plaatsen"] = repo.GetFreeStaanplaatsenByLocatie(reservering.Evenement.Locatie,
                                                                      reservering.DatumStart, reservering.DatumEind);
            return(View(reservering));
        }
Пример #2
0
        public ActionResult Plaats(FormCollection collection)
        {
            ReserveringViewModel  reservering = (ReserveringViewModel)Session["reservering"];
            StandplaatsRepository repo        = new StandplaatsRepository(new StandplaatsContext());

            string[]           plaatsids = collection["Plaatsen"].Split(',');
            List <Standplaats> plaatsen  = new List <Standplaats>();

            foreach (var s in plaatsids)
            {
                plaatsen.Add(repo.GetById(Convert.ToInt32(s)));
            }
            reservering.Staanplaatsen = plaatsen;
            return(RedirectToAction("Gegevens", "Reserveer"));
        }