public IActionResult Winkelmand() { Klant klant = new Klant(); klant.KlantID = Convert.ToInt32(HttpContext.Session.GetInt32("KlantID")); VMWinkelmand vMWinkelmand = new VMWinkelmand(); vMWinkelmand.klant = persistenceCode.KlantOphalen(klant.KlantID); vMWinkelmand.winkelRepository.winkelmandItems = persistenceCode.MandOphalen(); vMWinkelmand.totaal = persistenceCode.BerekenTotaal(); return(View(vMWinkelmand)); }
public IActionResult Winkelmandje(VMWinkelmand vMWinkelmand) { int klantnr = Convert.ToInt32(HttpContext.Session.GetString("user")); vMWinkelmand.Klant = PC.loadKlant(Convert.ToInt32(klantnr)); if (PC.ControleerWinkelmand(klantnr) == true) { ViewBag.Leeg = true; WinkelmandRepository winkelRepo = new WinkelmandRepository(); winkelRepo.WinkelmandItems = PC.loadWinkelmand(klantnr); vMWinkelmand.WinkelmandRepo = winkelRepo; vMWinkelmand.BerekendGegeven = PC.BerekenTotaal(); HttpContext.Session.SetString("TotaalInclu", Convert.ToString(vMWinkelmand.BerekendGegeven.TotaalInclu)); } else { ViewBag.Leeg = false; } return(View(vMWinkelmand)); }
public IActionResult Index(VMWinkelmand vMWinkelmand) { return(RedirectToAction("Winkelmandje")); }