예제 #1
0
        public ActionResult IncreaseQuantity(OrderGridItem product)
        {
            foreach (var it in items)
            {
                if (it.Name == product.Name)
                {
                    it.Quantity++;
                    break;
                }
            }

            return(View("Index", items));
        }
예제 #2
0
        public ActionResult Delete(OrderGridItem product)
        {
            OrderGridItem toDelete = null;

            foreach (var it in items)
            {
                if (it.Name == product.Name)
                {
                    toDelete = it;
                }
            }
            if (toDelete != null)
            {
                items.Remove(toDelete);
            }

            return(View("Index", items));
        }