public ActionResult Create(SuggestionAdd newItem) { if (ModelState.IsValid) { SuggestionBase addItem = m.AddSuggestion(newItem); return(RedirectToAction("Index")); } else { return(RedirectToAction("Create")); } }
public ActionResult Edit(int id, SuggestionEdit editItem) { if (ModelState.IsValid) { SuggestionBase editedItem = m.EditSuggestion(editItem); if (editedItem == null) { return(RedirectToAction("index")); } else { return(RedirectToAction("details", new { id = editedItem.Id })); } } else { return(RedirectToAction("index")); } }