Esempio n. 1
0
        public void saveAllEmployees(List <Employee> employeesForSave)
        {
            List <Doctor>    doctorsForSave   = new List <Doctor>();
            List <Secretary> secretaryForSave = new List <Secretary>();

            foreach (Employee employee in employeesForSave)
            {
                if (employee.EmployeeType == EmployeeType.Doctor)
                {
                    doctorsForSave.Add((Doctor)employee);
                }
                else if (employee.EmployeeType == EmployeeType.Secretary)
                {
                    secretaryForSave.Add((Secretary)employee);
                }
            }

            doctorRepository.SaveAll(doctorsForSave);
            secretaryRepository.SaveAll(secretaryForSave);
        }