public virtual ActionResult Index(string id, UserAwardViewModel model)
        {
            var ua = model.CreateAward(CurrentUser, CurrentResource);

            if (ua.Amount.HasValue)
            {
                TryAwardPointsTo(
                    Users[ua.Recipient],
                    ua.Amount.Value);
            }
            UserAwards.Save(ua);

            if (model.Email)
            {
                Messaging.SendAward(ControllerContext.RequestContext, ua);
                Notifier.Notify(
                    Severity.Success,
                    "Your award has been emailed!",
                    "The recipient should receive an email shortly with a link they can use to view or print their certificate.",
                    ua);
            }
            else
            {
                Notifier.Notify(
                    Severity.Success,
                    "Your award has been sent.",
                    "You indicated that you would print and deliver the certificate yourself, so we didn't email the recipient. Have fun delivering the good news!",
                    ua);
                TempData["popup-certificate"] = ua.Document.Id;
            }
            return(RedirectToAction(MVC.Site.Home.Index()));
        }
        public virtual ActionResult Award(string id, UserAwardViewModel model)
        {
            var award = Awards[id];

            var ua = model.CreateAward(CurrentUser, award);

            if (ua.Amount.HasValue)
            {
                Accounting.CreateProgramAward(
                    award,
                    CurrentUser,
                    Users[ua.Recipient],
                    ua.Amount.Value,
                    award.Content.Title
                    );
            }
            UserAwards.Save(ua);
            Messaging.SendAward(ControllerContext.RequestContext, ua);

            return(Index());
        }