public ActionResult DeleteConfirmed(int id) { Deptos deptos = db.Deptos.Find(id); db.Deptos.Remove(deptos); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /DeptosAdmin/Details/5 public ActionResult Details(int id = 0) { Deptos deptos = db.Deptos.Find(id); if (deptos == null) { return(HttpNotFound()); } return(View(deptos)); }
public ActionResult Edit(Deptos deptos) { if (ModelState.IsValid) { db.Entry(deptos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(deptos)); }
public ActionResult Create(Deptos deptos) { if (ModelState.IsValid) { db.Deptos.Add(deptos); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(deptos)); }