public ActionResult DeleteConfirmed(int id) { Despachador despachador = db.Despachadores.Find(id); despachador.Activo = false; db.Entry(despachador).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Nombres,Apellidos,Activo")] Despachador despachador) { if (ModelState.IsValid) { db.Entry(despachador).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(despachador)); }
public ActionResult Create([Bind(Include = "Id,Nombres,Apellidos")] Despachador despachador) { despachador.Activo = true; if (ModelState.IsValid) { db.Trabajadores.Add(despachador); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(despachador)); }
// GET: /Despachador/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Despachador despachador = db.Despachadores.Find(id); if (despachador == null) { return(HttpNotFound()); } return(View(despachador)); }