private void btnCreateRequest_Click(object sender, EventArgs e) { try { int indexVacation = cbxVacationTypes.SelectedIndex; if (!ValidateDate(indexVacation)) { return; } emp = EmployeeRepository.GetEmployee(Convert.ToInt32(cbxEmployeesSurname.SelectedValue)); switch (indexVacation) { case 0: CreateSickness(); break; case 1: CreateWithoutPayment(); break; case 2: CreateRegular(); break; case 3: CreateEducational(); break; default: MessageBox.Show("Не выбран тип отпуска."); break; } } catch (Exception exp) { MessageBox.Show(exp.Message); } }
public EducationalVacation(string name, Employee employee, DateTime dateStartVacation, DateTime dateEndVacation, string description) { EmployeeOnVacation = employee; DateEndVacation = dateEndVacation; DateStartVacation = dateStartVacation; Description = description; Name = name; }
public RegularVacation(string name, Employee employee, DateTime dateStartVacation, DateTime dateEndVacation, string description, bool isConfirmed) { EmployeeOnVacation = employee; DateEndVacation = dateEndVacation; DateStartVacation = dateStartVacation; Description = description; Name = name; IsConfirmed = isConfirmed; }
public SicknessVacation(string name,Employee employee, DateTime dateStartVacation, DateTime dateEndVacation, string description, string sickList) { EmployeeOnVacation = employee; DateEndVacation = dateEndVacation; DateStartVacation = dateStartVacation; Description = description; SickList = sickList; Name = name; }
public static List<Employee> GetAllEmployee() { List<Employee> listEmployees = new List<Employee>(); Employee first = new Employee(1, "Иванов", "Иван", "Иванович", 8500000); Employee second = new Employee(2, "Петров", "Петр", "Петрович", 7500000); Employee third = new Employee(3, "Сидоров", "Сидор", "Сидорович", 9500000); Employee four = new Employee(4, "Семенов", "Семен", "Семенович", 6500000); listEmployees.Add(first); listEmployees.Add(second); listEmployees.Add(third); listEmployees.Add(four); return listEmployees; }