コード例 #1
0
        public FloorDto GetFloor(int id)
        {
            var floor = _floorRepository.Get(id);

            if (floor == null)
            {
                return(null);
            }

            return(DTOMapper.GetFloorDto(floor));
        }
コード例 #2
0
        public FloorDto GetEmployeeFloor(int id)
        {
            var employee = _repository.Get(id);
            var floors   = _floorRepository.Floors.Select(x => DTOMapper.GetFloorDto(x));

            if (employee == null || floors == null)
            {
                return(null);
            }
            var employeeRoomId = employee.Seat.RoomId;
            var employeeFloor  = floors.Where(f => f.Rooms.Where(r => r.Id == employeeRoomId).First().Id == employeeRoomId).First();

            if (employeeFloor == null)
            {
                return(null);
            }
            return(employeeFloor);
        }
コード例 #3
0
 public IEnumerable <FloorDto> GetAllFloors()
 {
     return(_floorRepository.Floors.Select(x => DTOMapper.GetFloorDto(x)));
 }