public async void Editar(DatosVuelo vuelo) { var json = JsonConvert.SerializeObject(vuelo); var result = await cliente.PutAsync("/Tablero", new StringContent(json, Encoding.UTF8, "application/json")); result.EnsureSuccessStatusCode(); AlHaberMovimiento?.Invoke(); }
public async void Get() { var response = await cliente.GetAsync("http://vuelos.itesrc.net/Tablero"); if (response.IsSuccessStatusCode) { var jsonString = await response.Content.ReadAsStringAsync(); Model = JsonConvert.DeserializeObject <ObservableCollection <DatosVuelo> >(jsonString); AlHaberMovimiento?.Invoke(); } }
public async void Eliminar(DatosVuelo vuelo) { var json = JsonConvert.SerializeObject(vuelo); HttpRequestMessage message = new HttpRequestMessage(HttpMethod.Delete, "/Tablero"); message.Content = new StringContent(json, Encoding.UTF8, "application/json"); var result = await cliente.SendAsync(message); result.EnsureSuccessStatusCode(); AlHaberMovimiento?.Invoke(); }
public async void Get() { var client = new HttpClient(); var response = await client.GetAsync("http://localhost:8080/Hotel/Reservaciones"); if (response.IsSuccessStatusCode) { var jsonString = await response.Content.ReadAsStringAsync(); Model = JsonConvert.DeserializeObject <IEnumerable <DatosReservacion> >(jsonString); AlHaberMovimiento?.Invoke(); } }
public async void RegresarDatos() { ObservableCollection <DatosVuelo> model = null; var client = new HttpClient(); var response = await client.GetAsync("http://vuelos.itesrc.net/Tablero"); if (response.IsSuccessStatusCode) { var jsonString = await response.Content.ReadAsStringAsync(); model = JsonConvert.DeserializeObject <ObservableCollection <DatosVuelo> >(jsonString); ListaVuelos = model; AlHaberMovimiento?.Invoke(); } }
public async void Get() { //List<DatosVuelo> model = null; var client = new HttpClient(); var response = await client.GetAsync("http://vuelos.itesrc.net/Tablero"); if (response.IsSuccessStatusCode) { var jsonString = await response.Content.ReadAsStringAsync(); Model = JsonConvert.DeserializeObject <IEnumerable <DatosVuelo> >(jsonString); AlHaberMovimiento?.Invoke(); } }