private void BaseData(BasicEmployeeData employee) { employee.Name = maskedName.Text; employee.Surname = maskedSurname.Text; employee.WorkExperience = Convert.ToInt32(maskedExperience.Text); if (radioWorker.Checked) { employee.Position = Position.Workman; } if (radioJunior.Checked) { employee.Position = Position.JuniorStaff; } if (radioEngineer.Checked) { employee.Position = Position.Engineer; } if (radioOffice.Checked) { employee.Position = Position.OfficeWorker; } if (radioMissing.Checked) { employee.Education = Education.Missing; } if (radioSecondary.Checked) { employee.Education = Education.Secondary; } if (radioHigher.Checked) { employee.Education = Education.Higher; } }
private void buttonOk_Click(object sender, EventArgs e) { if (!(_maskedWorkExperience && _maskedName && _maskedSurname)) { MessageBox.Show("Одно или несколько полей базовых данных введены неверно или пустуют", "Ошибка ввода"); } else if (!(_maskedPosition && _maskedEducation)) { MessageBox.Show("Не выбрана информация о должности или образовании", "Ошибка ввода"); } else if (radioHourlyPay.Checked) { if (!_maskedHour) { MessageBox.Show("Поле отработанных часов введено неверно или пустует", "Ошибка ввода"); } else { var employee = new HourlyPay(); BaseData(employee); employee.HoursWorked = Convert.ToInt32(maskedHour.Text); Employee = employee; Close(); } } else if (radioRate.Checked) { if (!_maskedRate) { MessageBox.Show("Поле отработанных смен введено неверно или пустует", "Ошибка ввода"); } else { var employee = new Rate(); BaseData(employee); employee.WorkedShift = Convert.ToInt32(maskedRate.Text); Employee = employee; Close(); } } else if (radioSalary.Checked) { if (!_maskedSalary) { MessageBox.Show("Поле отработанных дней введено неверно или пустует", "Ошибка ввода"); } else { var employee = new Salary(); BaseData(employee); employee.SpentDays = Convert.ToInt32(maskedSalary.Text); Employee = employee; Close(); } } }
public void EducationTest(Education education) { var basicData = new BasicEmployeeData(); basicData.Education = education; }
public void PositionTest(Position position) { var basicData = new BasicEmployeeData(); basicData.Position = position; }
public void WorkExperienceTest(int years) { var basicData = new BasicEmployeeData(); basicData.WorkExperience = years; }