Beispiel #1
0
        public ActionResult ManageFlags(string Type, string Action, int id)
        {
            if (Type == "Picture")
            {
                Picture pic = PictureManager.GetPictureById(id);
                if (Action == "unflag")
                {
                    pic.IsFlagged = false;
                    PictureManager.EditPictureFlagged(pic);
                }
                else
                {
                    PictureManager.DeletePicture(pic);
                }
            }
            else
            {
                Comment comment = CommentsManage.GetCommentById(id);
                if (Action == "unflag")
                {
                    comment.IsFlagged = false;
                    CommentsManage.EditCommentFlagged(comment);
                }
                else
                {
                    CommentsManage.DeleteComment(comment);
                }
            }

            return(RedirectToAction("ManageFlags"));
        }
Beispiel #2
0
        public JsonResult GiveFlagged(string JsonFlag)
        {
            string  result  = JsonFlag;
            JObject jobj    = JObject.Parse(result);
            Comment comment = CommentsManage.GetCommentById(Convert.ToInt32(jobj["CommentId"]));

            comment.IsFlagged = true;
            CommentsManage.EditCommentFlagged(comment);
            String res = "Flag Comment Success";

            return(Json(res, JsonRequestBehavior.AllowGet));
        }