コード例 #1
0
        public ActionResult Delete(int id)
        {
            iCart_Service cart = Service_Center.GetCart_Service();

            int i = cart.DeleteItem(id);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult UpdateDecresceOne(int id)
        {
            iCart_Service cart = Service_Center.GetCart_Service();
            Cart          c    = new Cart();

            if (cart.GetbyID(id).BuyingQuantity > 1)
            {
                c.Id             = id;
                c.BuyingQuantity = cart.GetbyID(id).BuyingQuantity - 1;
                int i = cart.Update(c);
                return(RedirectToAction("Index"));
            }
            else
            {
                int i = cart.DeleteItem(id);
                return(RedirectToAction("Index"));
            }
        }