Exemplo n.º 1
0
 public IViewComponentResult Invoke()
 {
     if (_cookieServices.ReadCookie(HttpContext, "CART_INFORMATION") != null && HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier) != null)
     {
         ViewBag.Total = _context.CartDetailTable.Where(x => x.Cart.UserID == _cookieServices.ReadCookie(HttpContext, "CART_INFORMATION") && !x.Cart.IsPayed).Count();
         var dsdonhang = _context.DisplayCart(HttpContext, _cookieServices);
         return(View("_CheckoutTotalCartItem", dsdonhang));
     }
     else
     {
         _cookieServices.DeleteCookie(HttpContext, "CART_INFORMATION");
         return(Content(""));
     }
 }
Exemplo n.º 2
0
        public PartialViewResult DisplayCart()
        {
            var dsdonhangchuathanhtoan = _context.DisplayCart(HttpContext, _cookieServices);

            return(PartialView("ProductView/_ShowCart", dsdonhangchuathanhtoan));
        }