Esempio n. 1
0
 public ActionResult UpdateMajor(MajorViewModel major)
 {
     if (ModelState.IsValid)
     {
         var mjor = new Major();
         major.updateMajor(mjor);
         db.Entry(mjor).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("MajorsList"));
     }
     return(View());
 }
Esempio n. 2
0
 public ActionResult CreateMajor(MajorViewModel major)
 {
     if (ModelState.IsValid)
     {
         var newmajor = new Major();
         major.updateMajor(newmajor);
         db.Majors.Add(newmajor);
         db.SaveChanges();
         return(RedirectToAction("MajorsList"));
     }
     return(View());
 }