示例#1
0
        public IActionResult Checkout(string command)
        {
            try
            {
                if (command == "drop")
                {
                    cRepo.ClearCart();
                    return(View("index"));
                }
                else
                {
                    var cartItems = (from item in CIRepo.CartItems
                                     select item).ToList();
                    return(View("checkoutconfirm", cartItems));
                }
            }
            catch
            {
                return(View("Error", "home"));
            }

            //if (command=="drop")
            //{
            //    cRepo.ClearCart();
            //    return View("index");
            //}
            //else
            //{
            //    var cartItems = (from item in CIRepo.CartItems
            //                     select item).ToList();
            //    return View("checkoutconfirm",cartItems);
            //}
        }
示例#2
0
 public IActionResult Checkout(string command)
 {
     if (command == "drop")
     {
         cRepo.ClearCart();
         return(View("index"));
     }
     else
     {
         var cartItems = (from item in CIRepo.CartItems
                          select item).ToList();
         return(View("checkoutconfirm", cartItems));
     }
 }