// GET: ShoppingCart public ActionResult Add(int id) { ShoppingCart cart = (ShoppingCart)Session["cart"]; if (cart == null) { cart = new ShoppingCart(); } ShopModelsData db = new ShopModelsData(); MAYANH pr = db.MAYANHs.Find(id); if (pr != null) { cart.InsertItem(pr.IDMAY, pr.TENMAY, (double)pr.DONGIA); } Session["cart"] = cart; return(Redirect(Request.UrlReferrer.ToString())); }