Example #1
0
        public ActionResult Delete(int id)
        {
            var dao = new TinTucDAO();

            dao.Delete(id);
            return(RedirectToAction("Index"));
        }
Example #2
0
        public JsonResult Delete(int id)
        {
            var    dao  = new TinTucDAO();
            var    line = dao.GetByID(id);
            string link = Server.MapPath("/Data/Content/" + line.TINTUC_ID + ".cshtml");

            dao.DeleteFile(link);
            bool value = dao.Delete(id);

            return(Json(value, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult Delete(int id)
        {
            var dao    = new TinTucDAO();
            var result = dao.Delete(id);

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

            case false:
            {
                SetAlert("Xóa tin tức " + id + " không thành công!", "error");
                logger.Error("Xóa  tin tức " + id + " không thành công!");
                return(RedirectToAction("Index"));
            }
            }
            return(View("AllTin"));
        }