Beispiel #1
0
        public async Task <IActionResult> OnPostAsync(string id, string ret)
        {
            if (id is null)
            {
                return(NotFound());
            }

            Question = await questionHandler.QuestionFromId(id);

            if (Question is null)
            {
                return(NotFound());
            }

            await questionHandler.DeleteQuestion(Question, !HttpContext.User.Identity.IsAuthenticated);

            Deleted = true;

            if (!string.IsNullOrWhiteSpace(ret))
            {
                return(Redirect(ret));
            }

            return(Page());
        }
Beispiel #2
0
        public ActionResult DeleteQuestion(int QuestionID, int GameID)
        {
            if (CheckLoggedIn())
            {
                return(RedirectToAction("Index", "Login"));
            }

            question_Handler.DeleteQuestion(QuestionID, GameID);
            return(Questions(GameID));
        }