Esempio n. 1
0
        public ActionResult Create(Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                db.Teachers.Add(teacher);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(teacher);
        }
Esempio n. 2
0
 public ActionResult Edit(Teacher teacher)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teacher).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(teacher);
 }