public static OpenGraphVM GetOpenGraphVMForPledge(Pledge pledge, HttpRequestBase Request, UrlHelper Url) { var amt = CurrencyLogic.ToCurrency(pledge.Contributors, pledge.Originator.Currency).ToString("0.00"); var currencyPrefix = CurrencyLogic.GetCurrencyPrefix(pledge.Originator.Currency); return(new OpenGraphVM() { type = "article", title = "Help Yourself, Helping Others", description = $"{currencyPrefix}{amt} Pledged to {pledge.Charity.Name}", image = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Content("~/Images/Photos/FB_SiteImage1.jpg")}" }); }
public ActionResult Create() { ViewBag.Teams = db.Teams.ToList(); var PledgeVM = new CreatePledgeVM(); PledgeVM.CurrencySymbol = CurrencyLogic.GetCurrencyPrefix(CurrentUser().Currency); PledgeVM.Pledge = new Pledge(); PledgeVM.Pledge.Contributors.Add(new PledgeContributors { Sinner = CurrentUser(), SinnerID = CurrentUser().Id }); return(View(PledgeVM)); }
public static SocialVM GetSocialVMForPledgeContribution(PledgeContributors PC, string PCIdent, HttpRequestBase Request, UrlHelper Url) { string blurb; if (PC.AmountAnonymous) { blurb = $"{PC.Sinner.UserName} made a pledge to {PC.Pledge.Charity.Name}"; } else { blurb = $"{PC.Sinner.UserName} pledged {CurrencyLogic.GetCurrencyPrefix(PC.Currency)}{PC.Amount} to {PC.Pledge.Charity.Name}"; } return(new SocialVM() { Type = SocialVM.SocialType.PledgeContribution, LinkID = PC.ID.ToString(), ShareURL = Url.Action("Details", "Pledges", new { id = PC.Pledge.PledgeID }, protocol: Request.Url.Scheme) + "#" + PCIdent, Blurb = blurb }); }