Esempio n. 1
0
        //SearchStatus to SearchVM
        private async Task <Models.Accommodation.Likibu.PollSearchSessionResponse> PollSearchStatus(Models.Find.SearchVM searchVM)
        {
            Models.Accommodation.Likibu.PollSearchSessionResponse response = await Likibu.LikibuAccess.PollSearchStatus(searchVM.Search.LikibuSessionID);

            searchVM.Search.SessionStatus = bool.Parse(response.Status);

            return(response);
        }
        private static Models.Accommodation.Likibu.PollSearchSessionResponse ParseSearchStatusResponse(string retString)
        {
            var    jo       = JObject.Parse(retString);
            string searchid = jo["search_id"].ToString();

            string where = jo["where"].ToString();
            string country  = jo["country_code"].ToString();
            string bbox     = jo["bbox"].ToString();
            string partners = jo["status"]["partners"].ToString();
            string status   = jo["status"]["is_complete"].ToString();

            Models.Accommodation.Likibu.PollSearchSessionResponse ret = new Models.Accommodation.Likibu.PollSearchSessionResponse(searchid, where, country, bbox, status, partners);
            return(ret);
        }