public ActionResult Ajax_Update(int id) { TeacherDataController controller = new TeacherDataController(); Teacher SelectedTeacher = controller.FindTeacher(id); return(View(SelectedTeacher)); }
//GET : /Teacher/DeleteCofirm/{id} //Creating a method to allow us to delete a record, // we are still finding and displaying teacher in our actual view public ActionResult DeleteConfirm(int id) { TeacherDataController controller = new TeacherDataController(); Teacher NewTeacher = controller.FindTeacher(id); return(View(NewTeacher)); }
//GET : /Teacher/Show/{id} //here we are linking another dynamic rendered page to the controller public ActionResult Show(int id) { TeacherDataController controller = new TeacherDataController(); Teacher SelectedTeacher = controller.FindTeacher(id); if (SelectedTeacher != null) { ClassDataController classDataController = new ClassDataController(); IEnumerable <Class> listOfTeacherClasses = classDataController.ListTeachersClasses(id); SelectedTeacher.ListOfClasses = listOfTeacherClasses; } return(View(SelectedTeacher)); }