public async Task <IActionResult> JobOfferDetail(int?id) { if (id == null) { return(BadRequest()); } JobOfferDto offer = await jobOfferFacade.GetByIdWithQuestionsAsync(id.Value); if (offer == null) { return(NotFound()); } return(View(offer)); }
public async Task <IActionResult> AddJobApplication(int jobOfferId) { var jobOffer = await jobOfferFacade.GetByIdWithQuestionsAsync(jobOfferId); var user = await userFacade.GetByIdAsync(Int32.Parse(User.Identity.Name)); var jobSeeker = await jobSeekerFacade.GetByIdAsync(user.JobSeekerId.Value); var model = new AddJobApplicationModel { JobOffer = jobOffer, JobApplication = new JobApplicationDto { ApplicantId = jobSeeker.Id, Applicant = jobSeeker, JobOfferId = jobOffer.Id, JobOffer = jobOffer, Status = Status.Unresolved, Answers = new JobApplicationAnswerDto[jobOffer.Questions.Count] } }; return(View(model)); }