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