public ActionResult DeleteConfirmed(int id) { Daili daili = db.Dailis.Find(id); db.Dailis.Remove(daili); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IdDL,TenDL,DiaChi,SDT")] Daili daili) { if (ModelState.IsValid) { db.Entry(daili).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(daili)); }
public ActionResult Create([Bind(Include = "IdDL,TenDL,DiaChi,SDT")] Daili daili) { if (ModelState.IsValid) { db.Dailis.Add(daili); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(daili)); }
// GET: Dailis/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Daili daili = db.Dailis.Find(id); if (daili == null) { return(HttpNotFound()); } return(View(daili)); }