Exemple #1
0
        public JsonResult GetStudents(int groupId)
        {
            var groupOfStudents = new StudentManagementService().GetGroupStudents(groupId);
            var studentList = new List<Student>();
            foreach (var student in groupOfStudents)
            {
                if (ProjectManagementService.IsUserAssignedOnProject(student.Id, _currentProjectId) == false)
                {
                    studentList.Add(student);
                }
            }

            var students = studentList.Select(v => new SelectListItem
            {
                Text = v.FullName,
                Value = v.Id.ToString(CultureInfo.InvariantCulture)
            }).ToList();

            return Json(new SelectList(students, "Value", "Text"));
        }
        public List<StudentGroupUser> GetStudentGroupUserList(string groupName)
        {
            StudentGroupUserList = new List<StudentGroupUser>();

            var groupId = new GroupManagementService().GetGroupByName(groupName).Id;

            var students = new StudentManagementService().GetGroupStudents(groupId).ToList();
            var number = 1;

            foreach (var student in students)
            {
                StudentGroupUserList.Add(new StudentGroupUser
                {
                    Number = number,
                    Name = student.LastName + " " + student.FirstName + " " + student.MiddleName,
                    ProjectName = GetProjectNameList(student.Id),
                    ProjectRole = GetProjectRoleList(student.Id),
                    ProjectCreatorName = GetProjectCreatorNameList(student.Id),
                    QuentityOfProjects = GetProjectNameList(student.Id).Count()
                });
                number++;
            }

            return StudentGroupUserList;
        }