Esempio n. 1
0
        public ActionResult AddCart()
        {
            //create an empty cart
            Cart cart = new Cart();

            return View(cart);
        }
Esempio n. 2
0
 public ActionResult SaveCart(Cart cart)
 {
     carts.Add(cart);
     return View(cart);
 }
Esempio n. 3
0
        public ActionResult EditCart(int id)
        {
            //   products.Add(product);
            ViewBag.Message = "Your application description page.";
               Cart cart = new Cart();

            foreach (var find in carts)
            {

                if (find.Id == id)
                {

                    cart.UserId = find.UserId;

                    cart.Id = find.Id;

                    carts.Remove(find);
                    break;
                }

            }
            return View(cart);
        }