public IActionResult SearchCandidates(SearchCandidate filter) { if (filter.ProjectId < 1) { filter.ProjectId = null; } var candidates = _dataRepository.SearchCandidates(filter); var candidateDetails = new List <CandidateDetail>(); foreach (var candidate in candidates) { var candidateDetail = ConvertModel.CandidateToCandidateDetail(candidate, _dataRepository); candidateDetails.Add(candidateDetail); } var searchCandidate = new SearchCandidate(); searchCandidate.CandidateDetailList = candidateDetails; searchCandidate.Projects = _dataRepository.GetDimValuesByName(nameof(Project)).Select(a => new SelectListItem { Value = a.Id.ToString(), Text = a.Name }).ToList(); return(View("Index", searchCandidate)); }
public IActionResult CandidateDetail(int id) { var candidate = _dataRepository.GetCandidate(id); var candidateDetail = new CandidateDetail(); if (candidate != null) { candidateDetail = ConvertModel.CandidateToCandidateDetail(candidate, _dataRepository); } return(View(candidateDetail)); }