Ejemplo n.º 1
0
        public async Task <ActionResult <Kategori> > Delete(int id)
        {
            var kategori = await _kategoriService.Delete(id);

            if (kategori == null)
            {
                return(NotFound());
            }
            return(kategori);
        }
Ejemplo n.º 2
0
        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();
 }
Ejemplo n.º 4
0
 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));
     }
 }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        public IActionResult KategoriSil(Kategori kategori)
        {
            _kategoriService.Delete(kategori);

            return(Ok(true));
        }