Beispiel #1
0
        public IActionResult AddJob()
        {
            ClientJobViewModel model  = new ClientJobViewModel();
            string             userId = _userManager.GetUserId(HttpContext.User);
            var clientInfo            = _clientRepository.GetClientByUserId(userId);


            model.ClientID = clientInfo.Id;

            if (model.businessstreams.Count == 0)
            {
                model.businessstreams = new List <SelectListItem>();
                model.businessstreams.Add(new SelectListItem
                {
                    Value = "",
                    Text  = "-- 業界選択 --"
                });

                var businessstreams = _businessRepository.GetAll();

                foreach (var BusinessStrem in businessstreams)
                {
                    model.businessstreams.Add(new SelectListItem
                    {
                        Value = Convert.ToString(BusinessStrem.Id),
                        Text  = BusinessStrem.Name_jp
                    });
                }
            }

            if (model.Provinces.Count == 0)
            {
                model.Provinces = new List <SelectListItem>();
                model.Provinces.Add(new SelectListItem
                {
                    Value = "",
                    Text  = "--Choose--"
                });

                var provinces = _provinceRepository.GetAll();

                foreach (var province in provinces)
                {
                    model.Provinces.Add(new SelectListItem
                    {
                        Value = Convert.ToString(province.Id),
                        Text  = province.Name
                    });
                }
            }

            return(View(model));
        }
Beispiel #2
0
        public IActionResult SelectPrefrences(int param = 0)
        {
            var user      = _userManager.GetUserAsync(HttpContext.User).Result;
            var jobseeker = _jobSeekerRepository.GetJobSeekerByUserId(user.Id);

            if (param == 0)
            {
                if (jobseeker.InitialLoginCount > 1)
                {
                    return(RedirectToAction("Index", "Home"));
                }

                jobseeker.InitialLoginCount += 1;
                jobseeker.UpdatedDate        = DateTime.Now;
                _jobSeekerRepository.Update(jobseeker);
            }
            var jobSkills = jobseeker.JobSkills.Select(x => x.BusinessStreamId);

            var businessStreams = _businessStreamRepository.GetAll()
                                  .Where(x => x.Name != null & x.Name != "")
                                  .Select(x => new PrefrencesViewModel()
            {
                HasJob     = x.HasJob,
                Id         = x.Id,
                IsSelected = jobSkills.Contains(x.Id),
                Name       = x.Name
            });

            return(View(businessStreams));
        }
Beispiel #3
0
        public IActionResult Index()
        {
            SearchJobViewModel model = new SearchJobViewModel();

            if (model.businessstreams.Count == 0)
            {
                model.businessstreams = new List <SelectListItem>();
                model.businessstreams.Add(new SelectListItem
                {
                    Value = "",
                    Text  = "-- Choose  --"
                });

                var businessstreams = _businessRepository.GetAll();

                foreach (var BusinessStrem in businessstreams)
                {
                    model.businessstreams.Add(new SelectListItem
                    {
                        Value = Convert.ToString(BusinessStrem.Id),
                        Text  = BusinessStrem.Name
                    });
                }
            }
            if (model.Provinces.Count == 0)
            {
                model.Provinces = new List <SelectListItem>();
                model.Provinces.Add(new SelectListItem
                {
                    Value = "",
                    Text  = "--Choose--"
                });

                var provinces = _provinceRepository.GetAll();

                foreach (var province in provinces)
                {
                    model.Provinces.Add(new SelectListItem
                    {
                        Value = Convert.ToString(province.Id),
                        Text  = province.Name
                    });
                }
            }

            ViewData["HeaderSearch"] = true;
            return(View());
        }