コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }