public IHttpActionResult Delete(int id) { int val = CountryDB.DeleteCountry(id); if (val > 0) { return(Ok($"Country with id {id} Successfully deleted!")); } else { return(Content(HttpStatusCode.NotFound, $"Country with id {id} was not found to delete!!!")); } }
private void button2_Click(object sender, EventArgs e) { int arv = CountryDB.DeleteCountry(((ComboBoxItem)comboBox2.SelectedItem).HiddenValue); if (arv != 0) { MessageBox.Show("Oli delete " + arv + " rida", "Valmis", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Delete ebaõnnestus", "Viga", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//for delete public void DeleteInCountry(int CountryId) { CountryDB.DeleteCountry(CountryId); }
//for Deleteing the data from the table public void DeleteCountry(Country country) { countryDB = new CountryDB(); countryDB.DeleteCountry(country); }