public ActionResult Create(Schedule schedule) { if (ModelState.IsValid) { db.Schedules.Add(schedule); db.SaveChanges(); return RedirectToAction("Index", new { id = schedule.BackupTaskId }); } ViewBag.BackupTask = schedule.BackupTask; return View(schedule); }
public ActionResult Edit(Schedule schedule) { if (ModelState.IsValid) { db.Entry(schedule).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index", new { id = schedule.BackupTaskId }); } return View(schedule); }