public ActionResult Approve(Guid id)
{
var badge = RepositoryFactory.BadgeRepository.GetNullableById(id);
if (badge == null)
{
return HttpNotFound();
}
badge.Approved = true;
Message = "The badge was successfully approved and can now be earned by students";
_notificationService.Notify(badge.Creator, AuthenticatedUser,
"Your badge design has been approved",
"Congratulations, your \"" + badge.Name + "\" badge was approved!",
ActionLinkHelper.ActionLink(Url.Action("Earn", "Badge", new { area = string.Empty, id = badge.Id }), "Earn the badge"));
RepositoryFactory.BadgeRepository.EnsurePersistent(badge);
return RedirectToAction("Index");
}