public ActionResult DeleteConfirmed(int id) { AboutSayings aboutSayings = db.AboutSayings.Find(id); db.AboutSayings.Remove(aboutSayings); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Position,Text")] AboutSayings aboutSayings) { if (ModelState.IsValid) { db.Entry(aboutSayings).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aboutSayings)); }
public ActionResult Create([Bind(Include = "Id,Name,Position,Text")] AboutSayings aboutSayings) { if (ModelState.IsValid) { db.AboutSayings.Add(aboutSayings); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aboutSayings)); }
// GET: Admin/AboutSayings/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AboutSayings aboutSayings = db.AboutSayings.Find(id); if (aboutSayings == null) { return(HttpNotFound()); } return(View(aboutSayings)); }