Exemple #1
0
        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));
 }
Exemple #3
0
 public int DeleteNews(int id)
 {
     return(dal.DeleteNews(id));
 }