public IEnumerable <CurriculumVitaeDto> GetAllCurriculumVitaeByUserId(string userId) { try { //Validate user if (_userRepository.IsAuthenticated(userId)) { //GetUserProfile var cvs = _curriculumVitaeRepository.GetAllCurriculumVitaeByUserId(userId); if (cvs != null) { //Success return(cvs); } _loggingService.Info("Not profile for the user found: " + userId); } _loggingService.Info("UserId Authenticated Failed: " + userId); } catch (Exception ex) { //Error _loggingService.Error("An error has occurred", ex); } //Fail return(null); }
public GradFolioDto GetPortfolioByRefNum(long refId) { try { var portfolio = _portfolioRepository.GetPortfolioByRefNum(refId); var userId = portfolio.UserId; var template = new GradFolioDto(); //Profile if (_profileRepository.GetUserProfileByUserId(userId) != null) { template.Profile = _profileRepository.GetUserProfileByUserId(userId); } //Experience if (_experienceRepository.GetAllExperienceByUserId(userId) != null) { template.Experiences = _experienceRepository.GetAllExperienceByUserId(userId); } //Course if (_courseRepository.GetAllCourseByUserId(userId) != null) { template.Courses = _courseRepository.GetAllCourseByUserId(userId); } //Skill if (_skillRepository.GetAllSkillByUserId(userId) != null) { template.Skills = _skillRepository.GetAllSkillByUserId(userId); } //Award if (_awardRepository.GetAllAwardByUserId(userId) != null) { template.Awards = _awardRepository.GetAllAwardByUserId(userId); } //Interest if (_interestRepository.GetAllInterestByUserId(userId) != null) { template.Interests = _interestRepository.GetAllInterestByUserId(userId); } //Project if (_projectRepository.GetAllProjectByUserId(userId) != null) { template.Projects = _projectRepository.GetAllProjectByUserId(userId); } //CV if (_curriculumVitaeRepository.GetAllCurriculumVitaeByUserId(userId) != null) { template.CurriculumVitae = _curriculumVitaeRepository.GetAllCurriculumVitaeByUserId(userId).First(); } return(template); } catch (Exception ex) { //Error _loggingService.Error("An error has occurred", ex); } //Fail return(null); }