コード例 #1
0
ファイル: AdminController.cs プロジェクト: ias0nas/ocm-system
        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"));
        }
コード例 #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"));
        }
コード例 #3
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"));
        }