private void HandleSuccessfulCredit(Money payout) { try { PTCOfferWallView.Add(externalUsername, ptcOfferWallId, publishersWebsite.Id, payout); GlobalPostback.Create(GlobalPostbackType.PtcOfferWall, ptcOfferWallId, ptcOfferWallTitle, publishersWebsite.Id, externalUsername, subId2, subId3, ip, countryCode, payout, gender, age).Send(); } catch (Exception ex) { ErrorLogger.Log(ex); } }
public List <PTCOfferWall> GetOfferWalls() { var ptcOfferWallViews = PTCOfferWallView.GetWatchedToday(externalUsername, PublishersWebsite.Id); var activeOffers = PTCOfferWall.GetActive(countryCode, this.age, Gender, isMobile); var offersToReturn = new List <PTCOfferWall>(); foreach (var o in activeOffers) { if (ptcOfferWallViews.Count(v => v.PTCOfferWallId == o.Id) < o.SingleUserViewsPerDay) { offersToReturn.Add(o); } } offersToReturn.Shuffle(new Random()); return(offersToReturn); }
public static void Add(string username, int ptcOfferWallId, int publishersWebsiteId, Money publisherPayout) { var ptcOfferWallView = new PTCOfferWallView(username, ptcOfferWallId, publishersWebsiteId, publisherPayout); ptcOfferWallView.Save(); }