Exemple #1
0
        public JsonResult GetLecturers()
        {
            var _lecturers = new LecturerManagementService().GetLecturers();

            var lecturerList = new List<Lecturer>();
            foreach (var lecturer in _lecturers)
            {
                if (ProjectManagementService.IsUserAssignedOnProject(lecturer.Id, _currentProjectId) == false)
                {
                    lecturerList.Add(lecturer);
                }
            }

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

            return Json(new SelectList(lecturers, "Value", "Text"));
        }
        public IList<SelectListItem> GetLecturers()
        {
            var lecturers = new LecturerManagementService().GetLecturers();

            var lecturerList = new List<Lecturer>();

            foreach (var lecturer in lecturers)
            {
                if (ProjectManagementService.IsUserAssignedOnProject(lecturer.Id, ProjectId) == false)
                {
                    lecturerList.Add(lecturer);
                }
            }

            return lecturerList.Select(v => new SelectListItem
            {
                Text = v.LastName + " " + v.FirstName + " " + v.MiddleName,
                Value = v.Id.ToString(CultureInfo.InvariantCulture)
            }).ToList();
        }
        public List<StudentGroupUser> GetLecturerList()
        {
            LecturerList = new List<StudentGroupUser>();

            var lecturers = new LecturerManagementService().GetLecturers().ToList();
            var number = 1;

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

            //LecturerList.Sort();
            return LecturerList;
        }