//public ICommand DeleteCustomerCommand //{ // get { return new RelayCommand(DeleteCustomer); } //} private async void SaveCustomer() { if (SelectedCustomer == null || !SelectedCustomer.IsValid()) { Error = "Klant niet gewijzigd, hou rekening met de meldingen."; return; } else { Error = ""; } string input = JsonConvert.SerializeObject(SelectedCustomer); using (HttpClient client = new HttpClient()) { client.SetBearerToken(ApplicationVM.token.AccessToken); HttpResponseMessage response = await client.PutAsync("http://localhost:55853/api/customer", new StringContent(input, Encoding.UTF8, "application/json")); if (!response.IsSuccessStatusCode) { Console.WriteLine("error"); } } }
private bool CanExecuteAddClient() { if (SelectedCustomer == null) { return(false); } else { return(SelectedCustomer.IsValid()); } }