//public ISchedule LoadSchedule(int id, Func<int, ISchedulePresentationData> GetScheduleFromID, Func<List<WorkingPlan>> GetWorkingPlans, // Func<List<IEmployeePresentationData>> GetEmployees, Func<List<WorkingOptionOfEmployee>> GetWorkingOptionsOfEmployees, Func<>) public List <IEmployee> GetEmployeesWithoutWorkingPlan(List <WorkingPlan> plans, List <IEmployeePresentationData> employeeData, ISchedule schedule) { List <IEmployee> output = (from p in plans where p.ScheduleID == schedule.Id join e in employeeData on p.EmployeeID equals e.Id select schedule.CreateEmployee(e.Id, e.FirstName, e.LastName)).ToList(); return(output); }
public void FillEmployeesWithWorkingOptions(List <IEmployee> employees, List <IEmployee> employeesWithoutWorkingPlan, List <WorkingOptionOfEmployee> workingOptionOfEmployees, List <IWorkingOption> workingOptions, ISchedule schedule) { foreach (IEmployee employee in employeesWithoutWorkingPlan) { List <IWorkingOption> options = (from i in workingOptionOfEmployees where i.EmployeeID == employee.Id join o in workingOptions on i.WorkingOptionID equals o.Id select new WorkingOptionModel(o.Symbol, o.WorkingTime, o.StartingHour) as IWorkingOption).ToList(); employees.Add(schedule.CreateEmployee(employee.Id, employee.FirstName, employee.LastName, options)); } }