private void Button_Clicked(object sender, EventArgs e) { DiaControl diaControl = new DiaControl(); diaControl.id = "0"; Navigation.PushAsync(new GestionarDiaControl(asociado, cultivo.id_cultivo, diaControl)); }
public GestionarDiaControl(LoginResponseDto aso, string idCultivo, DiaControl dia) { InitializeComponent(); asociado = aso; diaControl = dia; cultivoId = idCultivo; if (diaControl.id != "0") { llenarDatosDiaControl(); } }
public async Task <ApiResponse> update(string token, DiaControl diaControl) { HttpClient client = await get(); client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token); var response = await client.PutAsync(url + "/" + diaControl.id, new StringContent(JsonConvert.SerializeObject(diaControl), Encoding.UTF8, "application/json")); ApiResponse apiResponse = new ApiResponse(); apiResponse.code = response.StatusCode.ToString(); apiResponse.message = await response.Content.ReadAsStringAsync(); return(apiResponse); }