Esempio n. 1
0
        public ActionResult Finalize(int boardId, int matchId, string finalizationRequest)
        {
            string response;

            try
            {
                if (finalizationRequest.Equals("verify", System.StringComparison.InvariantCultureIgnoreCase))
                {
                    response = "Your match has been marked as verified.  It will enter the approval queue and " +
                               "be processed as soon as there are no pending matches for either competitor in front of it.  " +
                               "The approval queue is processed aproximatly every 30 seconds.";
                    _service.ConfirmMatch(boardId, matchId, HttpContext.User.Identity.Name);
                }
                else
                {
                    response = "The match has been invalidated .  It will no longer be counted in the standings.";
                    _service.RejectMatch(boardId, matchId, HttpContext.User.Identity.Name);
                }
            }
            catch (ServiceException ex)
            {
                response = ex.Message;
            }

            // We're doing a redirect, so stuff the rejection response into TempData.
            TempData["StatusMessage"] = response;

            return(RedirectToAction("List", new { boardId }));
        }