public ActionResult DeleteConfirmed(int id) { DriverRunsRace driverRunsRace = db.DriverRunsRaces.Find(id); db.DriverRunsRaces.Remove(driverRunsRace); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DriverId,RaceId,ResultTypeId,RaceTime")] DriverRunsRace driverRunsRace) { if (ModelState.IsValid) { db.Entry(driverRunsRace).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DriverId = new SelectList(db.Drivers, "DriverId", "FirstName", driverRunsRace.DriverId); ViewBag.RaceId = new SelectList(db.Races, "RaceId", "RaceName", driverRunsRace.RaceId); ViewBag.ResultTypeId = new SelectList(db.RaceResultTypes, "ResultTypeId", "ResultTypeName", driverRunsRace.ResultTypeId); return(View(driverRunsRace)); }
// GET: DriverRunsRaces/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DriverRunsRace driverRunsRace = db.DriverRunsRaces.Find(id); if (driverRunsRace == null) { return(HttpNotFound()); } return(View(driverRunsRace)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DriverRunsRace driverRunsRace = db.DriverRunsRaces.Find(id); if (driverRunsRace == null) { return(HttpNotFound()); } ViewBag.DriverId = new SelectList(db.Drivers, "DriverId", "FirstName", driverRunsRace.DriverId); ViewBag.RaceId = new SelectList(db.Races, "RaceId", "RaceName", driverRunsRace.RaceId); ViewBag.ResultTypeId = new SelectList(db.RaceResultTypes, "ResultTypeId", "ResultTypeName", driverRunsRace.ResultTypeId); return(View(driverRunsRace)); }