public void StartParsingButton_Click(object sender, EventArgs e)
        {
            var index       = CategoryVacancy.SelectedItem.ToString().Substring(0, 2);
            var typeContact = TypeContact.SelectedItem.ToString();

            _seleniumService.OpenSeleniumService();
            if (_readingTask is null || _readingTask.IsCompleted)
            {
                _readingTask = Task.Run(() =>
                {
                    _seleniumService.Login(log, pass);
                    _seleniumService.OpenVacancyAdminPanel();
                    _seleniumService.SetCompany(IndexCompany.Text);
                    _vacancyService.SetCompany(Company);
                    _vacancies = _vacancyService.GetAll();
                    try
                    {
                        _seleniumService.CreateVacancies(_vacancies, index, typeContact, СontactTextBox.Text);
                    }
                    catch (Exception)
                    {
                    }
                });
            }
        }
Exemple #2
0
        public void AddControlForProbation(SimplePageVM model)
        {
            var vacancies = VacancyService.GetAll().IsActive().Where(v => v.Type == CenterVacancyType.Probation)
                            .OrderByDescending(v => v.PublishDate).Take(50).ToList();

            model.Controls.Add(
                new SimplePageVM.Control(Views.Page.PartnerVacancies,
                                         vacancies));
        }
Exemple #3
0
        public ActionResult VacanciesFor()
        {
            var vacancies = VacancyService.GetAll().IsActive().OrderByDescending(v =>
                                                                                 v.IsHot
                                                                                 ).OrderByDescending(v => v.PublishDate).Take(CommonConst.MaxHotVacansyCount);

            if (vacancies.Any(v => v.IsHot))
            {
                vacancies = vacancies.Where(v => v.IsHot);
            }
            return(View(PartialViewNames.VacanciesBlock, vacancies));
        }
Exemple #4
0
        public void AddControlForCareer(SimplePageVM model)
        {
//            var vacancies = VacancyService.GetAll().IsActive().OrderByDescending(v =>
//                v.IsHot
//                ).OrderByDescending(v => v.PublishDate).Take(CommonConst.MaxHotVacansyCount);
            var vacancies = VacancyService.GetAll().IsActive().Where(v => v.IsHot && !v.IsPartner &&
                                                                     v.Type != CenterVacancyType.Probation)
                            .OrderByDescending(v => v.PublishDate);

//            if (vacancies.Any(v => v.IsHot))
//                vacancies = vacancies.Where(v => v.IsHot);
            model.RightColumnControls.Add(
                new SimplePageVM.Control(PartialViewNames.VacanciesBlock, vacancies));
        }
Exemple #5
0
        public ActionResult VacanciesForEmployee(int?index)
        {
            if (!index.HasValue)
            {
                return(RedirectToAction(() => VacanciesForEmployee(1)));
            }

            var vacancies = VacancyService.GetAll().IsActive().Where(x => !x.IsPartner)
                            .Where(v => v.Type == CenterVacancyType.Emloyee)
                            .OrderByDescending(v => v.PublishDate).ToPagedList(index.Value - 1);

            return(View(ViewNames.Vacancies, new VacancyListVM {
                Vacancies = vacancies,
                Career = GetCareer(),
            }));
        }