public ActionResult DeleteConfirmed(int id) { PitchStats pitchStats = db.PitchStats.Find(id); db.PitchStats.Remove(pitchStats); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Key,PlayerID,CoachID,EarnedRunAvereage,OpponentBattingAverage,WHIP,StrikeOuts,StrikeOutPercentage,PickOffPercentage,WalksPerAtBat,WalksPerInning")] PitchStats pitchStats) { if (ModelState.IsValid) { db.Entry(pitchStats).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PlayerID = new SelectList(db.Players, "PlayerID", "FirstName", pitchStats.PlayerID); return(View(pitchStats)); }
// GET: PitchStats/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PitchStats pitchStats = db.PitchStats.Find(id); if (pitchStats == null) { return(HttpNotFound()); } return(View(pitchStats)); }