public ActionResult DeleteConfirmed(int id) { WrittenConvComment writtenConvComment = db.WrittenConvComments.Find(id); db.WrittenConvComments.Remove(writtenConvComment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Text,Date")] WrittenConvComment writtenConvComment) { if (ModelState.IsValid) { db.Entry(writtenConvComment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(writtenConvComment)); }
public ActionResult Create([Bind(Include = "Id,Text")] WrittenConvComment writtenConvComment) { if (ModelState.IsValid) { db.WrittenConvComments.Add(writtenConvComment); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(writtenConvComment)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WrittenConvComment writtenConvComment = db.WrittenConvComments.Find(id); if (writtenConvComment == null) { return(HttpNotFound()); } return(View(writtenConvComment)); }