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