public IActionResult MarkaDelete(int markaid) { var entity = _markaService.GetById(markaid); if (entity != null) { _markaService.Delete(entity); } return(Redirect("/admin/marka/list")); }
public ActionResult MarkaSil(int id) { /*var tablo =(from a in )*/ bool control = _markaService.Delete(id); if (control) { return(Json("ok", JsonRequestBehavior.AllowGet)); } return(View(_markaService.GetAll())); }
public IActionResult Delete(Marka marka) { var result = _markaService.Delete(marka); if (result.Success) { return(Ok(result.Message)); } return(BadRequest(result.Message)); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[4].Value) == 1) { try { _personalService.Delete(new Personal() { PersonalId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[0].Value) }); MessageBox.Show("Personal siliniyor"); } catch { MessageBox.Show("Silmek istediğin personelin üzerine tıkladığından emin ol"); } try { _kisiService.Delete(new Kisi() { KisiId = Convert.ToInt64(dgwTakip.CurrentRow.Cells[3].Value) }); MessageBox.Show("Personal silindi"); } catch { MessageBox.Show("Zimmetli Eşyası olan personeli silemezsin"); } } if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[5].Value) == 1 || Convert.ToInt32(dgwTakip.CurrentRow.Cells[5].Value) == 0) { try { _urunService.Delete(new Urun() { UrunId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[1].Value) }); MessageBox.Show("Ürün siliniyor"); } catch { MessageBox.Show("Kullanılan Ürünü silemezsin"); } try { _markaService.Delete(new Marka() { MarkaId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[1].Value) }); MessageBox.Show("Ürün silindi"); } catch { MessageBox.Show("Kullanılan markayı silemezsin"); } } if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[2].Value) == 1 || Convert.ToInt32(dgwTakip.CurrentRow.Cells[2].Value) == 0) { try { _zimmetService.Delete(new Zimmet() { ZimmetId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[0].Value) }); MessageBox.Show("Zimmet Silindi"); } catch { MessageBox.Show("TestZimmet"); } } } catch { } }