public ActionResult Delete(delete_action model) { bgk_dokuman bgk_dokuman = Db.bgk_dokuman.Find(model.Id); BGKFunction.RemoveUploadFile(bgk_dokuman.bgk_dosya); Db.bgk_dokuman.Remove(bgk_dokuman); Db.SaveChanges(); return(Content("<script>$.BGK.SuccessModal('Döküman başarılı bir şekilde silindi.', function (){ window.location.href='" + Url.Action("index") + "'; }, 1500);</script>")); }
public ActionResult Delete(delete_action model) { bgk_dokuman_kategori bgk_dokuman_kategori = Db.bgk_dokuman_kategori.Find(model.Id); foreach (var document in bgk_dokuman_kategori.bgk_dokuman) { BGKFunction.RemoveUploadFile(document.bgk_dosya); Db.bgk_dokuman.Remove(document); } Db.bgk_dokuman_kategori.Remove(bgk_dokuman_kategori); Db.SaveChanges(); return(Content("<script>$.BGK.SuccessModal('Kategori başarılı bir şekilde silindi.', function (){ window.location.href='" + Url.Action("index") + "'; }, 1500);</script>")); }