public ActionResult Huur(int filmNummer) { var filmInfo = db.GetFilm(filmNummer); Session[filmNummer.ToString()] = filmInfo.BandNr; return(RedirectToAction("Winkelmandje", "Home")); }
public ActionResult Verwijder(int id) { if (Session["klant"] == null) { return(RedirectToAction("Index")); } var film = VerhuurService.GetFilm(id); ViewBag.filmId = film.BandNr; ViewBag.filmTitel = film.Titel; return(View()); }
public ActionResult WinkelMandje(int?filmid) { try { if (Session["FilmLijst"] != null) { winkelmand = (List <MandjeItem>)Session["FilmLijst"]; } var Film = db.GetFilm(filmid); var klant = Session["klant"]; MandjeItem item = new MandjeItem((Klant)klant, Film); winkelmand.Add(item); Session["FilmLijst"] = winkelmand; return(View(winkelmand)); }catch (Exception) { return(View("Index", "Home")); } }
public ActionResult WinkelMandje(int?id) { if (Session["klant"] == null) { return(RedirectToAction("Index")); } List <Film> films = new List <Film>(); if (Session["films"] != null) { films = (List <Film>)Session["films"]; } if (id != null) { var film = VerhuurService.GetFilm((int)id); if (!(films.Contains(film))) { films.Add(film); } } Session["films"] = films; return(View(films)); }