Example #1
0
        public ActionResult Create(LessonViewModel lessonviewmodel)
        {
            if (ModelState.IsValid)
            {
                db.LessonViewModels.Add(lessonviewmodel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(lessonviewmodel);
        }
Example #2
0
 public ActionResult Edit(LessonViewModel lessonviewmodel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(lessonviewmodel).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(lessonviewmodel);
 }