public async Task <IActionResult> ElGradebookLessonRemove(ElGradebookLesson ElGradebookLesson)
        {
            if (ElGradebookLesson == null)
            {
                return(NotFound());
            }

            await _elGradebookRepository.RemoveElGradebookLessonAsync(ElGradebookLesson);

            return(RedirectToAction(nameof(ElGradebookLessons), new { ElGradebookLesson.ElGradebookId }));
        }
        //////////////////// Удаление занятия

        /// <summary>
        /// Удаление учебного занятия из журнала GET
        /// </summary>
        /// <param name="elGradebookId"></param>
        /// <returns></returns>
        public async Task <IActionResult> ElGradebookLessonRemove(int elGradebookLessonId)
        {
            ElGradebookLesson elGradebookLesson = await _elGradebookRepository.GetElGradebookLessonAsync(elGradebookLessonId);

            if (elGradebookLesson == null)
            {
                return(NotFound());
            }

            return(View(elGradebookLesson));
        }
        /// <summary>
        /// Редактирование учебного занятия в журнал
        /// </summary>
        /// <param name="elGradebookId"></param>
        /// <returns></returns>
        public async Task <IActionResult> ElGradebookLessonUpdate(int elGradebookLessonId)
        {
            ElGradebookLesson elGradebookLesson = await _elGradebookRepository.GetElGradebookLessonAsync(elGradebookLessonId);

            if (elGradebookLesson == null)
            {
                return(NotFound());
            }

            ViewBag.ElGradebookLessonTypes = _selectListRepository.GetSelectListElGradebookLessonTypes(elGradebookLesson.ElGradebookLessonTypeId);

            return(View("ElGradebookLessonCreateOrUpdate", elGradebookLesson));
        }
        public async Task <IActionResult> ElGradebookLessonMarksEdit(int elGradebookLessonId,
                                                                     int[] elGradebookLessonMarkIds,
                                                                     int[] elGradebookLessonMarkAttendanceTypes,
                                                                     int[] elGradebookLessonMarkPointNumbers)
        {
            ElGradebookLesson elGradebookLesson = await _elGradebookRepository.UpdateElGradebookLessonMarksAsync(elGradebookLessonId,
                                                                                                                 elGradebookLessonMarkIds, elGradebookLessonMarkAttendanceTypes, elGradebookLessonMarkPointNumbers);

            if (elGradebookLesson == null)
            {
                return(NotFound());
            }

            return(RedirectToAction(nameof(ElGradebookLessonMarksEdit), new { elGradebookLessonId }));
        }
        public async Task <IActionResult> ElGradebookLessonCreateOrUpdate(ElGradebookLesson ElGradebookLesson)
        {
            if (ElGradebookLesson == null)
            {
                return(NotFound());
            }

            if (ElGradebookLesson.ElGradebookLessonId == 0)
            {
                await _elGradebookRepository.AddElGradebookLessonAsync(ElGradebookLesson);
            }
            else
            {
                await _elGradebookRepository.UpdateElGradebookLessonAsync(ElGradebookLesson);
            }

            return(RedirectToAction(nameof(ElGradebookLessons), new { ElGradebookLesson.ElGradebookId }));
        }
        /// <summary>
        /// Добавление учебного занятия в журнал
        /// </summary>
        /// <param name="elGradebookId"></param>
        /// <returns></returns>
        public async Task <IActionResult> ElGradebookLessonCreate(int elGradebookId)
        {
            ElGradebook elGradebook = await _elGradebookRepository.GetElGradebookWithLessonsAsync(elGradebookId);

            if (elGradebook == null)
            {
                return(NotFound());
            }

            ElGradebookLesson elGradebookLesson = new ElGradebookLesson {
                Date = DateTime.Today
            };

            elGradebookLesson.ElGradebookId = elGradebook.ElGradebookId;
            elGradebookLesson.ElGradebook   = elGradebook;

            ViewBag.ElGradebookLessonTypes = _selectListRepository.GetSelectListElGradebookLessonTypes();

            return(View("ElGradebookLessonCreateOrUpdate", elGradebookLesson));
        }