Пример #1
0
        // 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());
        }
Пример #3
0
        // 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());
        }
        public Class getClass(int?id)
        {
            Class course = (Class)get(id);
            ClassDataController        contoller     = new ClassDataController();
            IEnumerable <SchoolObject> schoolObjects = contoller.findClasses("classes.classid = " + id);
            List <Class> classes = new List <Class>();

            foreach (SchoolObject obj in schoolObjects)
            {
                classes.Add((Class)obj);
            }
            return(course);
        }
        public Student getStudent(int?id)
        {
            Student                    student       = (Student)get(id);
            ClassDataController        contoller     = new ClassDataController();
            IEnumerable <SchoolObject> schoolObjects = contoller.findClasses("classes.studentid = " + id);
            List <Class>               classes       = new List <Class>();

            foreach (SchoolObject obj in schoolObjects)
            {
                classes.Add((Class)obj);
            }
            student.courses = classes;
            return(student);
        }
Пример #6
0
        public Teacher getTeacher(int?id)
        {
            Teacher                    teacher       = (Teacher)get(id);
            ClassDataController        contoller     = new ClassDataController();
            IEnumerable <SchoolObject> schoolObjects = contoller.findClasses("classes.teacherid = " + id);
            List <Class>               classes       = new List <Class>();

            foreach (SchoolObject obj in schoolObjects)
            {
                classes.Add((Class)obj);
            }
            teacher.courses = classes;
            return(teacher);
        }