Beispiel #1
0
 public ActionResult Edit([Bind(Include = "ID,Title,Description")] Course course)
 {
     if (ModelState.IsValid)
     {
         db.Entry(course).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(course));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ID,ChapterID,Title,Desc,Order")] Lesson lesson)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lesson).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ChapterID = new SelectList(db.Chapters, "ID", "Title", lesson.ChapterID);
     return(View(lesson));
 }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "ID,CourseID,Order,Title,Description")] Chapter chapter)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chapter).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseID = new SelectList(db.Courses, "ID", "Title", chapter.CourseID);
     return(View(chapter));
 }