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")); }
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)); }