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

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