public void NotifyApplicants(ref Vacancy vacancyForView, ref Applicant applicantForView) { Vacancy selectedVacancy; int i = 0; while (i < joblesses.Count) { applicantForView = joblesses[i]; joblesses[i].ShowJobSelection += ShowSearchVacancyForApplicant; selectedVacancy = joblesses[i].SearchJob(vacancies, ref vacancyForView); if (selectedVacancy != null) { RemoveApplicant(joblesses[i]); vacancies.Remove(selectedVacancy); } else { i++; } } }
//Проверка текущего соискателя на соответствие заданной вакансии public bool CheckVacancy(Vacancy vacancy) { return(_education.GetEducationArea() == vacancy.Education.GetEducationArea() && _workExperience.GetWorkingYears() >= vacancy.WorkExperience.GetWorkingYears()); }
public void SearchVacancyForApplicant(Vacancy vacancy, Applicant applicant) { int numberVacancy = -1, numberApplicant = -1; int i = 0; while (i < listViewForVacancies.Items.Count && numberVacancy == -1) { if (vacancy == (Vacancy)listViewForVacancies.Items[i].Tag) { numberVacancy = i; } i++; } i = 0; while (i < listViewForApplicants.Items.Count && numberApplicant == -1) { if (applicant == (Applicant)listViewForApplicants.Items[i].Tag) { numberApplicant = i; } i++; } listViewForApplicants.Items[numberApplicant].Selected = true; listViewForApplicants.Refresh(); Thread.Sleep(1000); listViewForVacancies.Items[numberVacancy].Selected = true; listViewForVacancies.Refresh(); labelForVacancy.Visible = true; labelForVacancy.Refresh(); richTextBoxForCompareVacancy.Visible = true; richTextBoxForCompareVacancy.Refresh(); labelForApplicant.Visible = true; labelForApplicant.Refresh(); richTextBoxForCompareApplicant.Visible = true; richTextBoxForCompareApplicant.Refresh(); AddInfoToRichTextBox(richTextBoxForCompareApplicant, applicant.ToString()); AddInfoToRichTextBox(richTextBoxForCompareVacancy, vacancy.ToString()); Thread.Sleep(2000); pictureBoxForComparison.Visible = true; if (applicant.CheckVacancy(vacancy)) { pictureBoxForComparison.Image = Image.FromFile("GreenCheckMark.png"); } else { pictureBoxForComparison.Image = Image.FromFile("RedDagger.png"); } pictureBoxForComparison.Refresh(); Thread.Sleep(3000); pictureBoxForComparison.Visible = false; labelForVacancy.Visible = false; labelForVacancy.Refresh(); richTextBoxForCompareVacancy.Visible = false; richTextBoxForCompareVacancy.Text = ""; richTextBoxForCompareVacancy.Refresh(); labelForApplicant.Visible = false; labelForApplicant.Refresh(); richTextBoxForCompareApplicant.Visible = false; richTextBoxForCompareApplicant.Text = ""; richTextBoxForCompareApplicant.Refresh(); if (applicant.CheckVacancy(vacancy)) { listViewForApplicants.Items[numberApplicant].Remove(); listViewForVacancies.Items[numberVacancy].Remove(); } else { listViewForVacancies.Items[numberVacancy].Selected = false; } listViewForVacancies.Refresh(); listViewForApplicants.Refresh(); Thread.Sleep(1000); if (!applicant.CheckVacancy(vacancy)) { listViewForApplicants.Items[numberApplicant].Selected = false; } }