// GET: Class/List public ActionResult List() { ClassDataController controller = new ClassDataController(); IEnumerable <Class> Classes = controller.ListClasses(); return(View(Classes)); }
// GET : /Teacher/Show public ActionResult Show(int id) { TeacherDataController controller = new TeacherDataController(); ViewBag.Teacher = controller.FindTeacher(id); ClassDataController ClassController = new ClassDataController(); ViewBag.Class = ClassController.FindTeacherClass(id); return(View()); }
// GET: Class/Show/{int id} public ActionResult Show(int id) { ClassDataController controller = new ClassDataController(); Class NewClass = controller.FindClass(id); ViewBag.Class = NewClass; TeacherDataController teachercontroller = new TeacherDataController(); ViewBag.Teacher = teachercontroller.FindTeacher((int)NewClass.TeacherId); return(View()); }