Esempio n. 1
0
        public async Task <IActionResult> Logout()
        {
            _cookieServices.DeleteCookie(HttpContext, "CART_INFORMATION");
            await _signInManager.SignOutAsync();

            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 2
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.IsDisplay).Count();
         var dsdonhang = _context.DisplayPopupCart(HttpContext, _cookieServices);
         return(View("_TotalCartItem", dsdonhang));
     }
     else
     {
         _cookieServices.DeleteCookie(HttpContext, "CART_INFORMATION");
         return(Content(""));
     }
 }