public ActionResult DeleteConfirmed(string id) { THONGTIN tHONGTIN = db.THONGTINs.Find(id); db.THONGTINs.Remove(tHONGTIN); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ThongtinID,Tieude,Noidung")] THONGTIN tHONGTIN) { if (ModelState.IsValid) { db.Entry(tHONGTIN).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tHONGTIN)); }
public ActionResult Create([Bind(Include = "ThongtinID,Tieude,Noidung")] THONGTIN tHONGTIN) { if (ModelState.IsValid) { db.THONGTINs.Add(tHONGTIN); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tHONGTIN)); }
// GET: THONGTINs/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } THONGTIN tHONGTIN = db.THONGTINs.Find(id); if (tHONGTIN == null) { return(HttpNotFound()); } return(View(tHONGTIN)); }