Exemplo n.º 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"));
        }
Exemplo n.º 2
0
        public JsonResult GivePictureFlagged(string JsonFlag)
        {
            string  result  = JsonFlag;
            JObject jobj    = JObject.Parse(result);
            Picture picture = PictureManager.GetPictureById(Convert.ToInt32(jobj["id"]));

            picture.IsFlagged = true;
            PictureManager.EditPictureFlagged(picture);
            String res = "Flag Picture Success";

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