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