示例#1
0
        public ActionResult RemoveStudent(int ClassId, int StudentId)
        {
            var adminRole = new AdminRole();

            var ViewValue = adminRole.RemoveStudent2(adminRole.GetClass(ClassId), adminRole.GetStudent(StudentId));

            return(RedirectToAction("Details", new { ClassId = ClassId }));
        }
示例#2
0
        public ActionResult Details(int ClassId)
        {
            var adminRole = new AdminRole();
            var students  = adminRole.GetStudentsOfClass(ClassId).Select(x => new StudentSubscriptionVM {
                StudentId = x.StudentId, Name = $"{x.StudentName}, {x.StudentFirstName}", Subscribed = true
            }).ToList();
            var ViewValue = new ClassWithStudentsVM {
                Classe = adminRole.GetClass(ClassId), Students = students
            };

            return(View(ViewValue));
        }
示例#3
0
        public ActionResult ListStudent(int ClassId)
        {
            var adminRole = new AdminRole();

            // var students = adminRole.GetStudents().Except(adminRole.GetStudentsOfClass(ClassId)).ToList();
            var students = adminRole.GetStudents().Select(x => new StudentSubscriptionVM {
                StudentId = x.StudentId, Name = $"{x.StudentName}, {x.StudentFirstName}", Subscribed = false
            }).ToList();
            var studentsSubscribed = adminRole.GetStudentsOfClass(ClassId).ToList();

            students.ForEach(x => x.Subscribed = studentsSubscribed.Any(y => y.StudentId == x.StudentId));
            var ViewValue = new ClassWithStudentsVM {
                Classe = adminRole.GetClass(ClassId), Students = students
            };



            return(View(ViewValue));//ajouter page de selection
        }
示例#4
0
        public ActionResult Delete(int ClassId)
        {
            var adminRole = new AdminRole();

            return(View(adminRole.GetClass(ClassId)));
        }