public ActionResult Edit(int id, ModelWhiskey modelwhiskey) { try { if (SingletonData.WhiskeyInitialized == false) { SingletonData.StoreDataWhiskey = new MockDataStoreWhiskey(); SingletonData.WhiskeyInitialized = true; } // TODO: Add update logic here return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult CreateWhiskey(ModelWhiskey modelwhiskey) { try { // TODO: Add insert logic here if (SingletonData.WhiskeyInitialized == false) { SingletonData.StoreDataWhiskey = new MockDataStoreWhiskey(); SingletonData.WhiskeyInitialized = true; } SingletonData.StoreDataWhiskey.items.Add(modelwhiskey); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }