Exemple #1
0
        public ActionResult DeleteComment(string idComment)
        {
            string status;
            User   user = Session["User"] as User;

            if (user != null && user.LEVEL.Equals("10"))
            {
                if (CommentDAO.DeleteCommentByID(int.Parse(idComment)))
                {
                    status = "success";
                    return(new JsonResult {
                        Data = new { status = status }
                    });
                }
                else
                {
                    status = "fail";
                    return(new JsonResult {
                        Data = new { status = status }
                    });
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home", new { area = "" }));
            }
        }