Beispiel #1
0
        public Schedule GetScheduleByDepartmentIdAndDate(int departmentId, DateTime date)
        {
            Schedule        schedule  = null;
            List <Schedule> schedules = _scheduleRepository.GetSchedulesByDepartmentId(departmentId);

            if (schedules != null)
            {
                foreach (Schedule temporarySchedule in schedules)
                {
                    if (date >= (temporarySchedule.StartDate) && date <= (temporarySchedule.EndDate))
                    {
                        schedule = temporarySchedule;
                    }
                }
                if (schedule != null)
                {
                    schedule.Department = _departmentController.GetDepartmentById(departmentId);
                    schedule.Shifts     = _scheduleShiftController.GetShiftsByScheduleId(schedule.Id);
                }
            }
            return(schedule);
        }
Beispiel #2
0
 public Department GetDepartmentById(int departmentId)
 {
     return(_departmentController.GetDepartmentById(departmentId));
 }
        public void GetDepartmentByIdTest()
        {
            Department department = _departmentController.GetDepartmentById(1);

            Assert.IsNotNull(department);
        }