Badges.Areas.Admin.Controllers.RevokeBadgeController.Revoke C# (CSharp) Method

Revoke() public method

public Revoke ( System.Guid id ) : System.Web.Mvc.ActionResult
id System.Guid
return System.Web.Mvc.ActionResult
        public ActionResult Revoke(Guid id)
        {
            // Set the BadgeSubmission's state to unsubmitted and unapproved
            var badgeSubmission = RepositoryFactory.BadgeSubmissionRepository.GetNullableById(id);

            if (badgeSubmission == null) return HttpNotFound();

            RepositoryFactory.BadgeSubmissionRepository.Remove(badgeSubmission);

            _notificationService.Notify(badgeSubmission.Creator, AuthenticatedUser,
                "Your badge has been revoked!",
                "Unforuntately, the \"" + badgeSubmission.Badge.Name + "\" badge has been revoked from you.",
                ActionLinkHelper.ActionLink(Url.Action("MyBadges", "Badge", new { area = string.Empty }), "View your badges"));

            Message = "The badge has been revoked.";
            return RedirectToAction("Index");
        }