public void Delete(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { kullaniciRepo.Delete(id); using (KullaniciBilgileriRepository kullaniciBilRepo = new KullaniciBilgileriRepository()) { try { kullaniciBilRepo.Delete(id); } catch { throw; } } } catch { throw; } } }
public ActionResult Sil(int id, string path) { using (KullaniciRepository repo = new KullaniciRepository()) { bool result = repo.Delete(id); TempData["Message"] = result == true ? new TempDataDictionary { { "class", "alert alert-success" }, { "msg", "İşletme silindi" } } : new TempDataDictionary { { "class", "alert alert-danger" }, { "msg", "İşletme silinemedi" } }; return(RedirectToAction("Liste")); } }
public void Delete(int id) { using (KullaniciRepository kullaniciRepo = new KullaniciRepository()) { try { kullaniciRepo.Delete(id); } catch (Exception ex) { throw; } } }
public bool KullaniciDelete(int KullaniciId) { try { bool isSuccess; using (var repo = new KullaniciRepository()) { isSuccess = repo.Delete(KullaniciId); } return(isSuccess); } catch (Exception ex) { throw new Exception("KullaniciBusiness:KullaniciRepository:Silme Hatası", ex); } }
public JsonResult Sil(int ID) { try { Kullanici dbKategori = _kullaniciRepository.GetById(ID); if (dbKategori == null) { return(Json("Silinecek Kayıt Bulunamadı.")); } _kullaniciRepository.Delete(ID); _kullaniciRepository.Save(); return(Json("Kayıt Başarılı Bir Şekilde Silindi")); } catch (Exception ex) { return(Json("Hata : " + ex)); } }