Ejemplo n.º 1
0
        private void Delete()
        {
            string id     = Request.Form["id"];
            bool   result = dao.Delete(int.Parse(id));

            Log.WritePage(result ? "SUCCESS" : "Error");
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int id)
        {
            var dao = new NewsDao();

            dao.Delete(id);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 删除公告
        /// </summary>
        /// <param name="newsId">公告id</param>
        /// <returns>返回处理结果</returns>
        public Enums.OpResult Delete(int newsId)
        {
            int count = dao.Delete(newsId);

            if (count > 0)
            {
                return(Result.除成功);
            }
            else
            {
                return(Result.除失败);
            }
        }
Ejemplo n.º 4
0
        public ActionResult Delete(long id)
        {
            try
            {
                // TODO: Add delete logic here

                NewsDao bdDao = new NewsDao();

                bdDao.Delete(id);
                // SetAlert("Xóa thành công", "success");
                return(RedirectToAction("Index"));
            }
            catch
            {
                // SetAlert("Không xóa được", "danger");
                return(View());
            }
        }
Ejemplo n.º 5
0
 public bool DeleteNews(int id) => _news.Delete(id);