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