Ejemplo n.º 1
0
        public ResponseMessageGetFloors GetFloors(RequestMessageGetFloors request)
        {
            ResponseMessageGetFloors response = new ResponseMessageGetFloors();

            //TODO gör om till en validator
            if (string.IsNullOrEmpty(request.BuildingCode))
            {
                throw new ValidationException("Building code cannot be empty");
            }

            List <Floor> floorList = new List <Floor>();

            List <BLfloor> blfloorList = dbPrisma.BLfloor.Where(x => x.blbuilding_code == request.BuildingCode).ToList();

            foreach (var blFloor in blfloorList)
            {
                Floor floor = new Floor();
                floor.BuildingCode = blFloor.blbuilding_code;
                floor.FloorCode    = blFloor.blfloor_code;
                floor.Description  = blFloor.descr;
                floorList.Add(floor);
            }

            response.Floors = floorList;
            return(response);
        }
Ejemplo n.º 2
0
        public ResponseMessageGetFloors GetFloors(RequestMessageGetFloors request)
        {
            ResponseMessageGetFloors response = new ResponseMessageGetFloors();

            //TODO gör om till en validator
            if (string.IsNullOrEmpty(request.BuildingCode))
                throw new ValidationException("Building code cannot be empty");

            List<Floor> floorList = new List<Floor>();

            List<BLfloor> blfloorList = dbPrisma.BLfloor.Where(x => x.blbuilding_code == request.BuildingCode).ToList();

            foreach (var blFloor in blfloorList)
            {
                Floor floor = new Floor();
                floor.BuildingCode = blFloor.blbuilding_code;
                floor.FloorCode = blFloor.blfloor_code;
                floor.Description = blFloor.descr;
                floorList.Add(floor);
            }

            response.Floors = floorList;
            return response;
        }