public ActionResult DeleteConfirmed(int id) { suggestionModel suggestionModel = db.suggestionModels.Find(id); db.suggestionModels.Remove(suggestionModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "RecordNum,Topic,Suggestion,Department")] suggestionModel suggestionModel) { if (ModelState.IsValid) { db.Entry(suggestionModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(suggestionModel)); }
public ActionResult Create([Bind(Include = "RecordNum,Topic,Suggestion,Department")] suggestionModel suggestionModel) { if (ModelState.IsValid) { db.suggestionModels.Add(suggestionModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(suggestionModel)); }
// GET: suggestionModels/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } suggestionModel suggestionModel = db.suggestionModels.Find(id); if (suggestionModel == null) { return(HttpNotFound()); } return(View(suggestionModel)); }