Example #1
0
        //GET : /Class/List
        public ActionResult List()
        {
            ClassDataController controller = new ClassDataController();
            IEnumerable <Class> Classes    = controller.ListClasses();

            return(View(Classes));
        }
Example #2
0
        //GET : /Class/Show/{id}
        public ActionResult Show(int id)
        {
            ClassDataController controller = new ClassDataController();
            Class NewClass = controller.FindClass(id);


            return(View(NewClass));
        }
Example #3
0
        //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));
        }