public IActionResult PutintoShoppingcart(string goodsName)
        {
            var goods = _goodsRepo.GetGoodsByName(goodsName);

            _shoppingService.putintoShoppingcart(goods);
            return(RedirectToAction("Index", "ShoppingCart"));
        }
예제 #2
0
        public void deleteMyGoods(string Name)
        {
            var goods = _goodsRepo.GetGoodsByName(Name);

            if (_goodsList.First(o => o.Name == Name).num > 1)
            {
                _goodsList.First(o => o.Name == Name).num--;
            }
            else
            {
                _goodsList.Remove(goods);
            }
        }