Beispiel #1
0
        public void GetHotels_DefaultSearchCriteria_ReturnAvailabilitySearch()
        {
            // Arrange
            // Act
            var result = _repository.GetHotels(_searchCriteria, DefaultPageSize);

            // Assert
            var availability = result.Should().BeOfType <AvailabilitySearch>().Subject;
        }
Beispiel #2
0
 public ReservationsTab(Model model)
 {
     this.model         = model;
     ListOfClients      = model.SearchedClients;
     ListOfHotels       = HotelRepository.GetHotels();
     ListOfReservations = model.Reservations;
     ListOfRooms        = model.Rooms;
     StartDate          = DateTime.Today;
     EndDate            = DateTime.Today;
 }
Beispiel #3
0
        public HotelDTO[] GetHotels()
        {
            IHotelRepository repository = new HotelRepository(this._connStrBuilder.ConnectionString);

            var hotels = repository.GetHotels();
            var hotelsDTOs = new List<HotelDTO>();

            foreach (var hotel in hotels)
            {
                hotelsDTOs.Add(new HotelDTO() { id = hotel.id, name = hotel.name, address = hotel.address });
            }
            return hotelsDTOs.ToArray();
        }
        public List <HotelDTO> GetHotels()
        {
            string           cs         = ConfigurationManager.ConnectionStrings["HotelServiceDB"].ConnectionString;
            IHotelRepository repository = new HotelRepository(cs);
            var hotels   = repository.GetHotels();
            var hotelDTO = new List <HotelDTO>();

            foreach (var hotel in hotels)
            {
                hotelDTO.Add(new HotelDTO()
                {
                    Id   = hotel.Id,
                    Name = hotel.Name
                });
            }
            return(hotelDTO);
        }
 // GET: api/Hotel
 public IEnumerable <Hotel> Get()
 {
     return(repo.GetHotels());
 }
 public List<Hotel> GetHotelsforUpdate()
 {
     HotelRepository hr = new HotelRepository();
     return hr.GetHotels();
 }