public ActionResult Create(Schedule schedule) { schedule.RoadScore = 0; schedule.HomeScore = 0; if (ModelState.IsValid) { db.Schedules.Add(schedule); db.SaveChanges(); return RedirectToAction("Index"); } return View(schedule); }
public ActionResult Edit(Schedule schedule) { if (ModelState.IsValid) { db.Entry(schedule).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(schedule); }