public ActionResult Create(CmStudentCourse cmstudentcourse) { if (ModelState.IsValid) { context.CmStudentCourses.Add(cmstudentcourse); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossiblecmStudents = context.CmStudents; ViewBag.PossibleclSubjects = context.ClSubjects; ViewBag.PossiblecmTeachers = context.CmTeachers; return View(cmstudentcourse); }
public ActionResult Edit(CmStudentCourse cmstudentcourse) { if (ModelState.IsValid) { context.Entry(cmstudentcourse).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossiblecmStudents = context.CmStudents; ViewBag.PossibleclSubjects = context.ClSubjects; ViewBag.PossiblecmTeachers = context.CmTeachers; return View(cmstudentcourse); }