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