Пример #1
0
        public ActionResult Edit(long id)
        {
            Homework thisHomework = _homeworkRepository.GetById(id);
            var      homework     = Mapper.Map <HomeworkEditModel>(thisHomework);
            var      teacherId    = GetTeacherId();
            var      detalleAnhosAcademicosActivos = _academicCourseRepository.GetAllAcademicYearDetails().ToList().FindAll(x => x.AcademicGrade.AcademicYear.IsActive);
            var      detallesFilteredByTeacher     = detalleAnhosAcademicosActivos.FindAll(x => x.Teacher != null && x.Teacher.Id == teacherId);
            var      query = detallesFilteredByTeacher.Select(detail => detail.Course).ToList();

            ViewBag.course = new SelectList(query, "Id", "Name");
            ViewBag.Years  = DateTimeController.GetYears();
            ViewBag.Months = DateTimeController.GetMonths();
            ViewBag.Days   = DateTimeController.GetDaysForMonthAndYearStatic(1, DateTime.UtcNow.Year);
            return(View("Edit", homework));
        }
 private List <AcademicGrade> GetAcademicGradesByAdmin()
 {
     return(_academicCourseRepository.GetAllAcademicYearDetails().Select(x => x.AcademicGrade).ToList());
 }