//GET : /Class/List public ActionResult List() { ClassDataController controller = new ClassDataController(); IEnumerable <Class> Classes = controller.ListClasses(); return(View(Classes)); }
//GET : /Class/Show/{id} public ActionResult Show(int id) { ClassDataController controller = new ClassDataController(); Class NewClass = controller.FindClass(id); return(View(NewClass)); }
//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)); }