Exemple #1
0
        public IActionResult CourseInfo(string Id, string schoolId, DateTime month)
        {
            if (month.Year < 2000)
            {
                month = DateTime.Now;
            }
            IEnumerable <Subscription> subscriptions = _schoolService.GetTeacherMonthSubscriptions(Id, month);
            Course course = _courseService.GetCourse(Id);
            TeacherCoursesViewModel model = new TeacherCoursesViewModel
            {
                Subscriptions = subscriptions,
                Month         = month,
                CurrentCourse = course
            };

            return(View(model));
        }
Exemple #2
0
        // GET: Teacher
        public ActionResult Index(string id)
        {
            var teacher = _context.Teachers.Include(t => t.ApplicationUser).SingleOrDefault(t => t.ApplicationUserId == id);

            if (teacher == null)
            {
                return(HttpNotFound());
            }
            var courses = _context.Courses.Where(c => c.TeacherId == teacher.TeacherId).Include(c => c.Specialization).Include(c => c.Semester).Include(C => C.Year).Include(x => x.Projects).ToList();

            var teacherCoursesProjects = new TeacherCoursesViewModel()
            {
                Teacher = teacher,
                Courses = courses
            };

            return(View(teacherCoursesProjects));
        }