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