public async Task <ActionResult> JobOfferList(JobOfferListModel model)
        {
            if (!model.ApplyFavorite)
            {
                var applicant = await ApplicantFacade.GetApplicantAccordingToUsernameAsync(User.Identity.Name);

                if (model.ApplyKeywords)
                {
                    model.Filter.KeywordNumbers = applicant.KeywordNumbers;
                }

                var result = await JobOfferFacade.GetJobOffersAsync(model.Filter);

                model.JobOffers = new List <JobOfferDto>(result.Items);
            }
            else
            {
                var applicant = await ApplicantFacade.GetApplicantAccordingToUsernameAsync(User.Identity.Name);

                var result = await JobOfferFacade.GetFavoriteJobOffersAsync(applicant.Id);

                model = new JobOfferListModel {
                    JobOffers = new List <JobOfferDto>(result.Items), ApplyFavorite = true
                };
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> JobOfferList()
        {
            var company = await CompanyFacade.GetCompanyAccordingToUsernameAsync(User.Identity.Name);

            var filter = new JobOfferFilterDto {
                CompanyId = company.Id
            };
            var result = await JobOfferFacade.GetJobOffersAsync(filter);

            var model = new JobOfferListModel {
                Filter = filter, JobOffers = new List <JobOfferDto>(result.Items)
            };

            return(View(model));
        }