Exemplo n.º 1
0
        public ActionResult Index()
        {
            Teacher teacher = unitOfWork.TeacherRepository.GetById(AuthenticationManager.LoggedUser.Id);

            if (teacher == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            TeachersIndexVM model = new TeachersIndexVM();

            model.CoursesSubjects = unitOfWork.CoursesSubjectsRepository.GetAllByTeacherId(teacher.Id).ToList();
            model.FullName        = teacher.FirstName + " " + teacher.LastName;

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            Teacher teacher = unitOfWork.TeacherRepository.GetById(AuthenticationManager.LoggedUser.Id);

            if (teacher == null)
            {
                return RedirectToAction("Index", "Home");
            }

            TeachersIndexVM model = new TeachersIndexVM();
            model.CoursesSubjects = unitOfWork.CoursesSubjectsRepository.GetAllByTeacherId(teacher.Id).ToList();
            model.FullName = teacher.FirstName + " " + teacher.LastName;

            return View(model);
        }