private void btnDeleteKitap_Click(object sender, EventArgs e)
 {
     kitapService.Delete(new Kitap
     {
         Id = Convert.ToInt32(dgwKitapListesi.CurrentRow.Cells[0].Value)
     });
     MessageBox.Show("Kitap Başarıyla Silinmiştir");
     LoadData();
 }
        public async Task <ActionResult <Kitap> > Delete(int id)
        {
            var kitap = await _kitapService.Delete(id);

            if (kitap == null)
            {
                return(NotFound());
            }
            return(kitap);
        }
        public IActionResult Delete(Kitap kitap)
        {
            var result = _kitapService.Delete(kitap);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Beispiel #4
0
        private void btnKitapDelete_Click(object sender, EventArgs e)
        {
            var row = dgwKitapIslemleri.CurrentRow;

            _kitapService.Delete(new Kitap
            {
                Id = Convert.ToInt32(tbxKitapUpdateId.Text)
            });
            MessageBox.Show("Kitap silindi");
            LoadKitaps();
            tbxUpdateRafNo.Text = "";
        }
        public IActionResult Sil(int id)
        {
            _kitapService.Delete(new Kitap {
                Id = id
            });
            _yorumlarService.Delete(new Yorumlar {
                Id = id
            });

            TempData.Add("message", "Kitap Başarı ile Silindi.!");

            return(RedirectToAction("Index"));
        }