// DELETE api/<controller>/5 public IHttpActionResult Delete(int id) { var content = new ResponseContent <Sirket>(null); using (var sirketBusiness = new SirketBusiness()) { content.Result = sirketBusiness.SirketSilById(id) ? "1" : "0"; return(new StandartResult <Sirket>(content, Request)); } }
private void btnSeciliSil_Click(object sender, EventArgs e) { try { bool success; using (var sirketBusiness = new SirketBusiness()) { success = sirketBusiness.SirketSilById(int.Parse(dgSirketListe.CurrentRow.Cells[0].Value.ToString())); } var message = success ? "Başarıyla silindi" : "Hata oluştu"; MessageBox.Show(message); } catch (Exception ex) { MessageBox.Show("Error happened: " + ex.Message); } sirketListele(); inputTemizle(); }