Ejemplo n.º 1
0
        public async Task <ActionResult> CommentActioned(int poiId, int commentId)
        {
            CheckForReadOnly();

            // if poi is awaiting review, publish now
            var poiManager = new POIManager();

            var poi = await poiManager.Get(poiId, true);

            var comment = poi.UserComments.Find(c => c.ID == commentId);

            using (var userManager = new UserManager())
            {
                var user = userManager.GetUser((int)UserID);

                if (POIManager.CanUserEditPOI(poi, user))
                {
                    using (var commentManager = new UserCommentManager())
                    {
                        await commentManager.ActionComment(user.ID, commentId);
                    }
                }
            }

            // return to approval queue
            return(RedirectToAction("details", "POI", new { id = poiId }));
        }
Ejemplo n.º 2
0
        public ActionResult CommentDelete(int id)
        {
            var commentManager = new UserCommentManager();
            var user           = new UserManager().GetUser((int)UserID);

            commentManager.DeleteComment(user.ID, id);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult CommentDelete(int id)
        {
            var commentManager = new UserCommentManager();
            var user           = new UserManager().GetUser(int.Parse(Session["UserID"].ToString()));

            commentManager.DeleteComment(user.ID, id);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        public ActionResult Comments()
        {
            UserManager userManager = new UserManager();

            var user = userManager.GetUser(int.Parse(Session["UserID"].ToString()));
            var list = new UserCommentManager().GetUserComments(user.ID).OrderByDescending(c => c.DateCreated);

            return(View(list));
        }
Ejemplo n.º 5
0
        public ActionResult Comments()
        {
            UserManager userManager = new UserManager();

            var user = userManager.GetUser((int)UserID);
            var list = new UserCommentManager().GetUserComments(user.ID).OrderByDescending(c => c.DateCreated);

            return(View(list));
        }
Ejemplo n.º 6
0
        public ActionResult Comments()
        {
            UserManager userManager = new UserManager();

            var user = userManager.GetUser(int.Parse(Session["UserID"].ToString()));
            var list = new UserCommentManager().GetUserComments(user.ID);

            return(View(list));
        }
Ejemplo n.º 7
0
        public ActionResult CommentDelete(int id)
        {
            var user           = new UserManager().GetUser(int.Parse(Session["UserID"].ToString()));
            var commentManager = new UserCommentManager();
            var list           = commentManager.GetUserComments(user.ID);

            //delete comment if owned by this user
            if (list.Where(c => c.User.ID == user.ID && c.ID == id).Any())
            {
                commentManager.DeleteComment(user.ID, id);
            }

            return(RedirectToAction("Comments"));
        }
Ejemplo n.º 8
0
        public static void Main(string[] args)
        {
            UserCommentManager manager = new UserCommentManager();

            manager.Run();
        }