Пример #1
0
        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);
        }
Пример #2
0
 public ActionResult Edit(Schedule schedule)
 {
     if (ModelState.IsValid)
     {
         db.Entry(schedule).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(schedule);
 }