Ejemplo n.º 1
0
        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)
                    {
                    }
                });
            }
        }