// GET: CartItems public ActionResult Index() { var db = new DB(); var cart = new ShoppingCart(); var cartItem = cart.GetCartItems(); return View(cartItem.ToList()); }
public ActionResult AddToCart(int id) { var db = new DB(); var cart = new ShoppingCart(); cart.AddToCart(id); var cartItem = cart.GetCartItems(); return View(cartItem); }
public ActionResult Checkout() { var db = new DB(); var cart = new ShoppingCart(); var cartItem = cart.GetCartItems(); if (Session["InnLogget"] != null) { Session["InnLogget"] = true; ViewBag.Loggetinn = true; return View(cartItem.ToList()); } else { Session["InnLogget"] = false; ViewBag.Loggetinn = false; return RedirectToAction("../Sikkerhet/Index"); } }