// GET: CartItems
 public ActionResult Index()
 {
     var db = new DB();
       var cart = new ShoppingCart();
       var cartItem = cart.GetCartItems();
     return View(cartItem.ToList());
 }
Esempio n. 2
0
 public ActionResult AddToCart(int id)
 {
     var db = new DB();
       var cart = new ShoppingCart();
       cart.AddToCart(id);
       var cartItem = cart.GetCartItems();
       return View(cartItem);
 }
Esempio n. 3
0
        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");
            }
        }