Beispiel #1
0
        public async Task <ActionResult> DeleteForum(int forumId)
        {
            if (!this.HttpContext.Session.HasSystemActionRights() || !this.HttpContext.Session.HasSystemActionRight(ActionRights.SystemManagement))
            {
                return(RedirectToAction("Index", "Home"));
            }

            var result = false;

            if (forumId > 0)
            {
                result = await ForumManager.DeleteForumAsync(forumId);
            }

            if (result)
            {
                return(Json(new { success = true }));
            }

            return(ValidationProblem("The forum wasn't deleted, due to an error. Please try again."));
        }