예제 #1
0
        public ActionResult ReportItem(int itemId, bool isPost)
        {
            string reporterId = User.Identity.GetUserId();

            if (User.IsInRole("Parent"))
            {
                var    user    = _userService.FindById(reporterId);
                string message = "Another parent reported a post made by you child on Klukk, please take a moment to view the post here. http://localhost:5080/User/Reports?userId=" + user.Id;
                Helpers.LogMessage(message, user.Email);
            }
            if (isPost)
            {
                _postService.AddReportPost(itemId, reporterId);
            }
            else
            {
                _postService.AddReportComment(itemId, reporterId);
            }

            return(null);
        }