public async Task <ActionResult <Kategori> > Delete(int id) { var kategori = await _kategoriService.Delete(id); if (kategori == null) { return(NotFound()); } return(kategori); }
public ActionResult KategoriSil(int id) { bool kontrol = _kategoriService.Delete(id); if (kontrol) { return(Json("ok", JsonRequestBehavior.AllowGet)); } return(View(_urunService.GetUrunByMarka())); }
private void tbxCategoryDelete_Click(object sender, EventArgs e) { _kategoriService.Delete(new Kategori { Id = Convert.ToInt32(tbxCategory2Id.Text) }); MessageBox.Show("Kategori Silindi"); tbxCategory2Id.Text = ""; tbxCategory2Name.Text = ""; LoadCategories(); }
public IActionResult Delete(int kategoriId) { try { if (_service.GetById(kategoriId) != null) { _service.Delete(kategoriId); return(Ok()); } else { return(NotFound("Kategori Bulunamadı")); } } catch (Exception ex) { return(BadRequest(ex.Message)); } }
private void Sil() { if (id != -1) { try { kategoriServis.Delete(new Entities.Concrete.Kategori { Id = id }); MessageBox.Show("Kategori silme başarılı oldu.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exception) { MessageBox.Show(exception.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Silinecek kategoriyi listeden seçiniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public IActionResult KategoriSil(Kategori kategori) { _kategoriService.Delete(kategori); return(Ok(true)); }