コード例 #1
0
        public int ToBasketShop(Guid id, bool add)
        {
            Grocery model = new Grocery(id);

            model.SetModel();
            model.InBasket = add;
            model.AddOrUpdate();
            int i = model.GetAllInBasket().Count();

            return(i);
        }
コード例 #2
0
 public ActionResult Edit(Grocery model)
 {
     try
     {
         model.Validfy();
         model.AddOrUpdate();
         return(RedirectToAction("Index"));
     }
     catch (GroceryException ex)
     {
         TempData["catchedError"] = new KeyValuePair <string, Grocery>(ex.Message, model);
         return(RedirectToAction("New"));
     }
 }