public IActionResult exportMain() { List <Lessons> LessonsList = _IRedisCacheService.GetLessons(); return(View(LessonsList)); }
public IActionResult Lesson() { lessonList = _IRedisCacheService.GetLessons(); ViewBag.Lessons = lessonList; return(View()); }
public IActionResult Instructor() { _IRedisCacheService.GetBranchs().ForEach(x => instructorViewModel.selectList.Add(new SelectListItem(x.name, x.id.ToString()))); instructorList = _IRedisCacheService.GetInstructors(); ViewBag.Instructor = instructorList; ViewBag.branchList = branch_TeacherManager.List(); ViewBag.LessonList = _IRedisCacheService.GetLessons(); return(View(instructorViewModel)); }
public IActionResult addInstructorLesson(AddLessonModel addLessonModel) { _IRedisCacheService.GetLessons().Where(x => x.isFull != true).ToList().ForEach(x => addLessonModel.selectListLesson.Add(new SelectListItem(x.name, x.id.ToString()))); branch_TeacherList = branch_TeacherManager.List().Where(x => x.teacherid == addLessonModel.TeacherId).ToList(); branch_TeacherList.ForEach(x => addLessonModel.selectListBranch.Add(new SelectListItem(x.branchName, x.branchid.ToString()))); if (addLessonModel != null) { Validation <Subject> valid = subjectManager.Insert(addLessonModel); if (valid.ErrorList.Count == 0) { _IRedisCacheService.GetAllRemove(); Teacher teacher = instructorManager.List().Find(x => x.id == addLessonModel.TeacherId); addLessonModel.name = teacher.name; addLessonModel.surname = teacher.surname; if (addLessonModel.isPDF) { TempData.MyPut("model", addLessonModel); return(RedirectToAction("exportSubject", "ExportPDF")); } else { toastNotification.AddSuccessToastMessage("Ders Ve Konu Kayıtları Başarıyla Gerçekleşti!"); return(RedirectToAction("addInstructorLesson", "SelectLesson", new { id = addLessonModel.TeacherId })); } } else { valid.ErrorList.ForEach(x => toastNotification.AddWarningToastMessage(x)); return(RedirectToAction("addInstructorLesson", new { id = addLessonModel.TeacherId })); } } else { toastNotification.AddWarningToastMessage("Ders Ve Konu Ekleme İşlemi Sırasında Bir Hata Meydana Geldi!"); return(RedirectToAction("addInstructorLesson", new { id = addLessonModel.TeacherId })); } }