public ActionResult DeleteNews(News deletedNews, string deletingImgPath) { // deleting old image from its path : if (System.IO.File.Exists(deletingImgPath)) { System.IO.File.Delete(deletingImgPath); } bool successfullyDeletingNew = DAL.DeleteNews(deletedNews.ID); if (successfullyDeletingNew) { return(RedirectToAction("GetAllNews")); } else { return(View(deletedNews)); } }
/// <summary> /// 删除新闻 /// </summary> /// <param name="newsModel"></param> /// <returns></returns> public int DeleteNews(string newsId) { return(newsDal.DeleteNews(newsId)); }
public int DeleteNews(int id) { return(dal.DeleteNews(id)); }