Esempio n. 1
0
        public object GetAllCollections()
        {
            FullInfoRepository repository = new FullInfoRepository();
            var collections = repository.GetAllCollections();

            return(collections);
        }
Esempio n. 2
0
        public void GenerateJsonPlaces()
        {
            FullInfoRepository repository = new FullInfoRepository();
            var collections = repository.GetAllCollections();

            foreach (dynamic collection in collections)
            {
                var name = collection["name"].ToString();
                if (name.Contains("Hotel"))
                {
                    var country = name.Replace("Hotel", "");
                    _service = new HotelService(country);

                    var cityList    = _service.GetCities();
                    var stateList   = _service.GetStates();
                    var countryList = _service.GetCountry();

                    foreach (var city in cityList)
                    {
                        var local = new
                        {
                            cidade = city
                        };
                    }
                }
            }
        }
Esempio n. 3
0
        public ActionResult <string> RemoveHotelFullInfo([FromRoute] string country, [FromRoute] string id)
        {
            FullInfoRepository repository = new FullInfoRepository();

            repository.RemoveHotel(id, country);
            return(Ok());
        }
Esempio n. 4
0
        public ActionResult <string> UpdateHotelFullInfo([FromBody] HotelFullInfo hotel, [FromRoute] string country, [FromRoute] string id)
        {
            FullInfoRepository repository = new FullInfoRepository();

            repository.UpdateHotel(id, country, hotel);
            return(Ok(hotel));
        }
Esempio n. 5
0
        public ActionResult <string> GetFullInfo(string id, string pais)
        {
            FullInfoRepository repository = new FullInfoRepository();
            var hotel = repository.GetHotel(id, pais);

            if (hotel == null)
            {
                return(NotFound());
            }

            return(Ok(hotel));
        }
Esempio n. 6
0
        public ActionResult GetFullInfoList([FromBody] FilterModel filter)
        {
            if (string.IsNullOrEmpty(filter.Country) || filter.Limit == 0)
            {
                return(BadRequest());
            }

            FullInfoRepository repository = new FullInfoRepository();
            var list = repository.GetHoteis(filter);

            return(Ok(list));
        }