Beispiel #1
0
 public ActionResult SaveLessonInformation(LessonFullInf lesson, int action = 0, int cancel = 0)
 {
     if (action == 0)
     {
         return(RedirectToAction("ViewLessons", "Teacher"));
     }
     else
     {
         LessonsDB.UpdateLessonInf(lesson.Lesson_ID, lesson.Class_ID, lesson.Teacher_ID, lesson.Subject_ID, lesson.Date);
         return(RedirectToAction("ViewLessons", "Teacher"));
     }
 }
Beispiel #2
0
        public ActionResult EditLesson(int lessonID)
        {
            LessonFullInf lesson  = LessonsDB.GetLessonFullInf(lessonID);
            List <Class>  classes = ClassesDB.GetClasses();

            ViewBag.Classes = classes;
            List <TeacherShortInf> teachers = TeachersDB.GetTeachersShortInf();

            ViewBag.Teachers = teachers;
            List <Subject> subjects = SubjectsDB.GetSubjects();

            ViewBag.Subjects = subjects;
            return(View(lesson));
        }
Beispiel #3
0
        public ActionResult AddMarkForm(int lessonID)
        {
            LessonFullInf lesson  = LessonsDB.GetLessonFullInf(lessonID);
            int           classID = lesson.Class_ID;

            List <Pupil> pupils = PupilsDB.GetPupilsInClass(classID);

            ViewBag.Pupils = pupils;

            List <TypeOfWork> types = TypesOfWorkDB.GetTypesOfWork();

            ViewBag.Types = types;

            ViewData["LessonID"] = lessonID;

            return(View());
        }
Beispiel #4
0
        public ActionResult SelectAbsentPupils(int lessonID)
        {
            LessonFullInf lesson = LessonsDB.GetLessonFullInf(lessonID);

            List <Pupil> pupils = PupilsDB.GetPupilsInClass(lesson.Class_ID);

            TeacherController.classID = lesson.Class_ID;

            ViewBag.Pupils = pupils;

            ViewData["Lesson"] = lesson.Lesson_ID;

            // список ID учеников, которые были ранее отмечены как отсутствующие на данном уроке
            List <int> previosAbsent = LessonsDB.GetAbsentPupils(lessonID);

            ViewBag.AbsentPupils = previosAbsent;

            // удаляем всех отсутствующих отмеченных ранее
            MarksDB.DeleteAbsentPupilsMark(lessonID);

            return(View());
        }