示例#1
0
        public async Task SearchVets()
        {
            string date                = SelectedDate.Substring(0, 10);
            string day                 = date[0].ToString() + date[1];
            string dateUrlParse        = date[0].ToString() + date[1].ToString() + "-" + date[3].ToString() + date[4].ToString() + "-" + date[8].ToString() + date[9].ToString();
            string urlGetAvailableVets = EndPoints.SERVER_URL + EndPoints.GET_AVAILABLE_VETS + dateUrlParse + "&" + selectedHour;

            Getvets = new RequestPicker <BaseModel>();
            Getvets.StrategyPicker("GET", urlGetAvailableVets);
            APIResponse response = await Getvets.ExecuteStrategy(null);

            if (response.IsSuccess)
            {
                var jsonSerializerSettings = new JsonSerializerSettings();
                jsonSerializerSettings.MissingMemberHandling = MissingMemberHandling.Ignore;
                Veterinarians = JsonConvert.DeserializeObject <List <UserVetToShowModel> >(response.Response, jsonSerializerSettings);
                foreach (var v in Veterinarians)
                {
                    VetsList.Add(v);
                }
            }
            else
            {
                Exception e;
            }
        }