// 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 NyVare(Vare best) { var db = new DB(); if(db.SettInnNyVare(best)) { return RedirectToAction("Index"); } return View(); }
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"); } }
public ActionResult Index() { var db = new DB(); List<Vare> alleBestillinger = db.listAlleVare(); return View(alleBestillinger); }