Example #1
0
        public async Task <ActionResult> JobOfferEdit(JobOfferEditModel model)
        {
            await JobOfferFacade.EditJobOfferAsync(model.JobOffer);

            await JobOfferFacade.EditJobOffersKeywordsAsync(model.JobOffer.Id, model.Keywords);

            return(RedirectToAction("JobOfferList", "Company"));
        }
Example #2
0
        public async Task <ActionResult> JobOfferCreate(JobOfferEditModel model)
        {
            var company = await CompanyFacade.GetCompanyAccordingToUsernameAsync(User.Identity.Name);

            model.JobOffer.CompanyId = company.Id;
            Guid id = await JobOfferFacade.CreateJobOfferAsync(model.JobOffer);

            await JobOfferFacade.EditJobOffersKeywordsAsync(id, model.Keywords);

            return(RedirectToAction("JobOfferList", "Company"));
        }
Example #3
0
        public ActionResult JobOfferCreate()
        {
            var model = new JobOfferEditModel {
                JobOffer = new JobOfferDto(), Keywords = new List <bool>()
            };

            for (int i = 0; i < Enum.GetNames(typeof(Keyword)).Length; i++)
            {
                model.Keywords.Add(false);
            }

            return(View(model));
        }
Example #4
0
        public async Task <ActionResult> JobOfferEdit(Guid id)
        {
            var jobOffer = await JobOfferFacade.GetJobOfferAsync(id);

            var model = new JobOfferEditModel {
                JobOffer = jobOffer, Keywords = new List <bool>()
            };

            for (int i = 0; i < Enum.GetNames(typeof(Keyword)).Length; i++)
            {
                model.Keywords.Add(jobOffer.KeywordNumbers.Contains(i));
            }

            return(View(model));
        }