public ActionResult shopcartdel(ShoppCar sh) { ShoppCar s = shop.ShoppCar.FirstOrDefault(a => a.ShopCardID == sh.ShopCardID); shop.ShoppCar.Remove(s); if (shop.SaveChanges() > 0) { return(Content("true")); } else { return(Content("false")); } }
public ActionResult shopcartinfo(ShoppCar cart) { ShoppCar c = new ShoppCar(); c.SKUId = cart.SKUId; c.UserID = cart.UserID; shop.ShoppCar.Add(c); if (shop.SaveChanges() > 0) { return(Content("true")); } else { return(Content("false")); } }