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