private SelectListItem Map(ApplicationDataset item) { SelectListItem selectListItem = new SelectListItem(); selectListItem.Value = item.ApplicationId.ToString(); selectListItem.Text = item.Application.Name; return(selectListItem); }
private List <ApplicationDataset> Map(int applicationId, int id) { List <ApplicationDataset> applicationDatasets = new List <ApplicationDataset>(); var applicationDataset = new ApplicationDataset { ApplicationId = applicationId, DatasetId = id }; applicationDatasets.Add(applicationDataset); return(applicationDatasets); }
public async Task <ActionResult <ApplicationDataset> > GetAppliedCV([FromRoute] int postId, [FromRoute] int applicationId) { ApplicationDataset result = await _recruitmentService.GetAppliedCV(applicationId); if (result != null) { if (result.PostId != postId) { return(NotFound()); } await _employerService.ViewApplication(applicationId); return(Ok(result)); } return(NotFound()); }
public async Task <ApplicationDataset> GetAppliedCV(int applicationId) { Application application = await _uow.AppliedCVRepository.GetFirst(filter : a => a.ApplicationId == applicationId, includeProperties : "CV,CV.Employee,CV.Employee.Account"); ApplicationDataset result = _mapper.Map <ApplicationDataset>(application); IEnumerable <Section> sections = await _uow.SectionRepository.Get(filter : section => section.CVId == application.CVId, includeProperties : "SectionType"); IEnumerable <SectionField> fields = await _uow.SectionFieldRepository.Get(filter : field => field.Section.CVId == application.CVId, includeProperties : "Section"); IEnumerable <Models.Video> videos = await _uow.VideoRepository.Get(filter : video => video.Section.CVId == application.CVId, includeProperties : "Section,VideoStyle"); result.CV.Sections = (from section in sections select new CVSectionDataset() { SectionId = section.SectionId, CVId = application.CVId, SectionTypeId = section.SectionTypeId, Text = section.Text, Title = section.DisplayTitle, Icon = section.SectionType.Image, Fields = (from field in fields where field.SectionId == section.SectionId select new CVFieldDataset() { FieldId = field.FieldId, Name = field.FieldTitle, Text = field.Text }).ToList(), Videos = (from video in videos where video.SectionId == section.SectionId select new VideoDataset() { AspectRatio = video.AspectRatio, ThumbUrl = video.ThumbUrl, VideoUrl = video.VideoUrl, CoverUrl = video.CoverUrl, VideoId = video.VideoId, VideoStyle = new VideoStyleDataset() { StyleId = video.VideoStyle.StyleId, StyleName = video.VideoStyle.StyleName } }).ToList() }).ToList(); return(result); }