Exemplo n.º 1
0
        public async Task <IActionResult> RemoveAsync(string id)
        {
            System.Diagnostics.Debug.WriteLine(id);
            _cart.Remove(id);
            await _userClient.UpdateAsync(_userClient.GetCurrentUser());

            return(RedirectToAction("Index", "Cart"));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> RemoveAsync(string id)
        {
            System.Diagnostics.Debug.WriteLine(id);
            _cart.Remove(id);
            await _userClient.UpdateAsync(_userClient.GetCurrentUser());

            User    user = _userClient.GetCurrentUser();
            Product p    = _productClient.GetProductById(id);

            _logClient.SaveLog(user.Username, user.Username + " remove product " + p.Name + " from cart successfully!");
            return(RedirectToAction("Index", "Cart"));
        }