public void AddInstructor(InstructorNameGroup Instructor)
        {
            Instructor s = new Instructor
            {
                LastName    = Instructor.LastName,
                CourseTitle = Instructor.CourseTitle,
            };

            db.Instructor.Add(s);
            db.SaveChanges();
        }
Ejemplo n.º 2
0
 public ActionResult CreateInstructor([Bind(Include = "LastName, CourseTitle")] InstructorNameGroup i)
 {
     try
     {
         if (ModelState.IsValid)
         {
             Istudent.AddInstructor(i);
             return(RedirectToAction("Instructors"));
         }
     }
     catch (RetryLimitExceededException /* dex */)
     {
         //Log the error (uncomment dex variable name and add a line here to write a log.
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     return(View(i));
 }