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); }
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")); } }