Esempio n. 1
0
 public static SocialVM GetSocialVMForPledgeOffSet(Offset offset, string OffsetIdent, HttpRequestBase Request, UrlHelper Url)
 {
     return new SocialVM()
     {
         Type = SocialVM.SocialType.OffSet,
         LinkID = offset.ID.ToString(),
         ShareURL = Url.Action("Details", "Pledges", new {id = offset.Pledge.PledgeID}, protocol: Request.Url.Scheme) +"#" + OffsetIdent,
         Blurb = $"{offset.Offsetter.UserName} logged {offset.OffsetAmount} {offset.Pledge.Activity_Units} to help fulfill a pledge to {offset.Pledge.Charity.Name}"
     };
 }
Esempio n. 2
0
        public ActionResult Create( Offset offset)
        {
            if (ModelState.IsValid)
            {
                db.Offsets.Add(offset);
                BusinessLogic.Messaging.Add(Message.LevelEnum.alert_success, "Thank you. your activity has been logged", Message.TypeEnum.StickyAlert, CurrentUser());

            }
            else
            {
                BusinessLogic.Messaging.Add(Message.LevelEnum.alert_danger , "There was a problem trying to save your activity. Sorry.", Message.TypeEnum.TemporaryAlert , CurrentUser());
            }

            db.SaveChanges();
            return RedirectToAction("Details", "Pledges", new { id = offset.PledgeID });
        }