public ActionResult Delete(int id)
        {
            var dao    = new BinhLuanDAO();
            var result = dao.Delete(id);

            switch (result)
            {
            case true:
            {
                SetAlert("Xóa bình luận " + id + " thành công!", "success");
                logger.Info("Xóa bình luận " + id + " thành công!");
                return(RedirectToAction("Index"));
            }

            case false:
            {
                SetAlert("Xóa bình luận " + id + " không thành công!", "error");
                logger.Error("Xóa bình luận " + id + " không thành công!");
                return(RedirectToAction("Index"));
            }
            }
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Delete(int id)
        {
            dao.Delete(id);

            return(RedirectToAction("Index", "BinhLuan"));
        }