public ActionResult DeleteConfirmed(int id) { RaceSignUp raceSignUp = db.RaceSignUps.Find(id); db.RaceSignUps.Remove(raceSignUp); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID")] RaceSignUp raceSignUp) { if (ModelState.IsValid) { db.Entry(raceSignUp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(raceSignUp)); }
public ActionResult Create([Bind(Include = "ID,FirstName,LastName,Gender,DateOfBirth,TshirtSize,RaceID")] RaceSignUp raceSignUp) { if (ModelState.IsValid) { // take in a race id and assign it to a participant who registered for that race id db.RaceSignUps.Add(raceSignUp); db.SaveChanges(); return(RedirectToAction("PaymentConfirmation")); } return(View(raceSignUp)); }
// GET: RaceSignUps/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RaceSignUp raceSignUp = db.RaceSignUps.Find(id); if (raceSignUp == null) { return(HttpNotFound()); } return(View(raceSignUp)); }