コード例 #1
0
ファイル: HomeController.cs プロジェクト: begum88/damacana
        public ActionResult AddCart()
        {
            //create an empty cart
            Cart cart = new Cart();

            return View(cart);
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: selenadali/damacana
 public ActionResult Buy()
 {
     Cart cart = new Cart();
     cart.TotalPrice = 0;
     cart.cartproducts = new List<Product>();
     cart.Id = i;
     cart.UserId = 1;
     Product product = new Product();
     foreach (Product p in cartproducts)
     {
         product.Id = p.Id;
         product.Name = p.Name;
         product.Price = p.Price;
         cart.cartproducts.Add(product);
         cart.TotalPrice += p.Price;
         i++;
     }
     return View(cart);
 }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: begum88/damacana
 public ActionResult SaveCart(Cart cart)
 {
     //carts.Add(cart);
     return View(cart);
 }