public IEnumerable <RoomBLL> findByState(string state) { PGRoomRepository repository = repositoryFactory.getRoomRepository(); IEnumerable <RoomDAL> list = repository.findByState(state); return(list.Select(r => new RoomBLL { number = r.number, stage = r.stage, state = r.state, block = r.block, capacity = r.capacity, amountOfStudents = r.amountOfStudents })); }
public IEnumerable <RoomBLL> getNotAvailableForAccomodation() { PGRoomRepository repository = repositoryFactory.getRoomRepository(); IEnumerable <RoomDAL> list = repository.getNotAvailableForAccomodation(); return(list.Select(r => new RoomBLL { number = r.number, stage = r.stage, state = r.state, block = r.block, capacity = r.capacity, amountOfStudents = r.amountOfStudents })); }
public void updateState(RoomBLL updatedRoom) { RoomDAL roomDAL = new RoomDAL { number = updatedRoom.number, stage = updatedRoom.stage, state = updatedRoom.state, block = updatedRoom.block, capacity = updatedRoom.capacity, amountOfStudents = updatedRoom.amountOfStudents }; PGRoomRepository repository = repositoryFactory.getRoomRepository(); repository.updateState(roomDAL); }