public IActionResult Get() { using (_context) { var data = _proposalRepository.GetAll().ToList(); return(Ok(data)); } }
public async Task <IActionResult> GetAll(int conferenceId) { var proposals = await proposalRepository.GetAll(conferenceId); if (!proposals.Any()) { return(new NoContentResult()); } return(new ObjectResult(proposals)); }
public UserInfoJson GetUserInfo(string username) { var AllProposals = ProposalRepository.GetAll(); var AllStudents = StudentRepository.GetAll(); return(SelectBy(s => s.SocialSecurityNumber == username).AsEnumerable() .Select(p => new UserInfoJson { ID = p.ID, SocialSecurityNumber = p.SocialSecurityNumber, FirstName = p.FirstName, LastName = p.LastName, Role = "Professor", ProfessorDegree = p.Universities_Manager.Any() ? 6 : (p.Faculties_Manager.Any() ? 5 : (p.IsCouncilMember ? 4 : (p.EducationalGroups_Manager.Any()) ? 3 : (AllStudents.Any(AS => AS.FirstGuidingProfessorID == p.ID) || AllStudents.Any(AS2 => AS2.SecondGuidingProfessorID == p.ID) ? 2 : (AllProposals.Any(AP => AP.FirstJudgeID == p.ID) || AllProposals.Any(AP2 => AP2.SecondJudgeID == p.ID) ? 1 : 0)))), EducationalGroupTitle = p.EducationalGroup.Name, UniversityRankTitle = p.UniversityRank.Title, LatestDegree = p.LatestDegree, MainSpecialty = p.MainSpecialty, FacultyName = p.Faculty.Name }).FirstOrDefault()); }