示例#1
0
        public ActionResult Delete(int id, string confirmButton)
        {
            var album = _repo.Albums
                        .Single(a => a.AlbumId == id);

            _repo.Delete(album);

            return(View("Deleted"));
        }
示例#2
0
        public void RemoveFromCart(int id, string cartid)
        {
            //Get the cart
            var cartItem = _repo.Carts.Single(
                cart => cart.CartId == cartid &&
                cart.RecordId == id);

            if (cartItem != null)
            {
                if (cartItem.Count > 1)
                {
                    cartItem.Count--;
                }
                else
                {
                    _repo.Delete(cartItem);
                }
            }
        }