Example #1
0
        public ActionResult SearchJobSeeker(string skillId, string cityId)
        {
            var skills = skillService.GetAll();
            var cities = _cityService.GetAll();

            cities.Insert(0, new City {
                Id = "All", Name = "All"
            });
            skills.Insert(0, new Skill {
                Id = "All", Description = "All"
            });
            //Lets setup a session to control when to display Invite and Decline button
            HttpContext.Session.Set <string>("InviteDecline", "no");
            HttpContext.Session.Set <string>("SkillId", skillId);
            HttpContext.Session.Set <string>("CityId", cityId);

            var jobSeekerRecruiterSearchContainer = new JobSeekerRecruiterSearchContainer
            {
                JobSeekerRecruiterSearch = _jobSeekerService.GetJobSeekerBySkillAndCity(skillId, cityId),
                Cities = cities,
                Skills = skills
            };

            return(View("RecruiterSearch", jobSeekerRecruiterSearchContainer));
        }
Example #2
0
        private void LoadData(Contestant contestant)
        {
            AllLocations  = _locationService.GetAllSelectList();
            AllCategories = _categoriesService.GetAllSelectList();

            Languages = _langService.GetAll(contestant.LanguagesId);
            Skills    = _skillsService.GetAll <Skills>(contestant.LanguagesId, false);

            Worktypes = contestant.WorkType?.Split(',');
        }
Example #3
0
        public IActionResult Index()
        {
            var addSkillViewModel = new AddSkillViewModel
            {
                SkillLevels     = jobSeekerService.GetSkillLevel(),
                Skills          = skillsService.GetAll(),
                JobSeekerSkills = jobSeekerService.GetJobSeekerSkills(HttpContext.Session.Get <string>("JobSeekerId"))
            };

            return(View(addSkillViewModel));
        }
Example #4
0
        private void LoadData(Jobs job, User user)
        {
            AllLocations  = _locationService.GetAllSelectList();
            AllCategories = _categoriesService.GetAllSelectList();

            Companies = _companyService.GetAll(user);
            Languages = _langService.GetAll(job.LanguageId);
            Skills    = _skillsService.GetAll <Skills>(job.TagsId, false);

            Worktypes = job.WorkType?.Split(',');
        }
        public JsonResult GetTags(string searchTerm)
        {
            var dataList = _skillsService.GetAll();

            if (searchTerm != null)
            {
                dataList = dataList.Where(x => x.Title.ToLower().Contains(searchTerm.ToLower()));
            }

            var modifiedData = dataList.Select(x => new
            {
                id   = x.Id,
                text = x.Title
            });

            return(Json(modifiedData));
        }
Example #6
0
        public async Task <IActionResult> Details(int id, [FromServices] IResumeService _resumeService)
        {
            var job = await _jobsService.GetByIdAsyncMapped(id);

            if (job == null)
            {
                return(RedirectToAction("NotFound", "Home"));
            }

            job.SkillsMapped = _skillsService.GetAll <SkillsViewModel>(job.TagsId, true);
            //  job.LanguagesMapped = _langService.GetAllMapped(job.LanguageId);

            var user = await _userManager.GetUserAsync(User);

            if (user != null)
            {
                string[] items;
                if (!(job.resumeFilesId is null))
                {
                    items = job.resumeFilesId?.Split(',');

                    job.ResumeFiles = _resumeService.GetAllAsNoTracking()
                                      .Where(x => x.UserId == user.Id)
                                      .Where(x => !(((IList)items).Contains(x.Id.ToString())))
                                      .Select(x => new SelectListModel
                    {
                        Value = x.Id.ToString(),
                        Text  = x.Title,
                    }).ToAsyncEnumerable();
                }
            }

            await _jobsService.AddRatingToJobs(id, 0.5);

            return(this.View(job));
        }
Example #7
0
        // [Route("candidates/all")]
        public async Task <IActionResult> Index(int currentPage = 1, string Sort = null)
        {
            var viewModel = new ContestantViewModel
            {
                AllLocations  = _locationService.GetAllSelectList(),
                AllCategories = _categoriesService.GetAllSelectList()
            };

            viewModel.Skills = _skillsService.GetAll <Skills>(viewModel.SkillsId, false);
            //viewModel.ReturnUrl = Url.Page(null, pageHandler: null, new { currentPage = currentPage }, protocol: Request.Scheme);

            var entity = _contestantsService.GetAllAsNoTracking()
                         .Where(x => (x.isApproved == ApproveType.Success) && !x.isArchived && (x.profileVisiblity == 0))
                         .Select(x => new Contestant
            {
                Id           = x.Id,
                FullName     = x.FullName,
                LocationId   = x.LocationId,
                CreatedOn    = x.CreatedOn,
                PosterID     = x.PosterID,
                RatingVotes  = x.RatingVotes,
                payRate      = x.payRate,
                SalaryType   = x.SalaryType,
                Promotion    = x.Promotion,
                About        = x.About,
                userSkillsId = x.userSkillsId,
                LanguagesId  = x.LanguagesId
            });



            if (!String.IsNullOrEmpty(viewModel.LanguagesId))
            {
                string[] langs = viewModel.LanguagesId?.Split(", ");
                entity = entity.Where(x => ((IList)langs).Contains(x.LanguagesId));
            }
            if (!String.IsNullOrEmpty(viewModel.WorkType))
            {
                string[] type = viewModel.WorkType?.Split("%2C");
                entity = entity.Where(x => ((IList)type).Contains(x.WorkType));
            }
            if (!String.IsNullOrEmpty(viewModel.LocationId))
            {
                entity = entity.Where(s => s.LocationId.Equals(viewModel.LocationId));
            }
            if (viewModel.CategoryId > 0)
            {
                entity = entity.Where(x => x.CategoryId == viewModel.CategoryId);
            }

            switch (Sort)
            {
            case "Рейтинг":
                entity = entity.OrderByDescending(x => x.RatingVotes);
                break;

            case "Последни":
                entity = entity.OrderBy(x => x.CreatedOn);
                break;

            case "Най-нови":
                entity = entity.OrderByDescending(x => x.CreatedOn);
                break;

            case "Заплата":
                entity = entity.OrderBy(x => x.payRate);
                break;

            default:
                entity = entity.OrderByDescending(x => x.CreatedOn);
                break;
            }


            if (await entity.AnyAsync()) // prevent 'SqlException: The offset specified in a OFFSET clause may not be negative.'
            {
                int count = await entity.AsQueryable().AsNoTracking().CountAsync().ConfigureAwait(false);

                viewModel.Pager = new Pager(count, currentPage);

                var result = entity
                             .Skip((viewModel.Pager.CurrentPage - 1) * viewModel.Pager.PageSize)
                             .Take(viewModel.Pager.PageSize);

                viewModel.Result = result.To <ContestantViewModel>().AsAsyncEnumerable();
            }
            else
            {
                viewModel.Result = null;
            }


            return(View(viewModel));
        }