public static void CreateCrowdflower(string Username, Money SentBalance, Money CalculatedBalance, string TrackingInfo, OfferwallsLogStatus Status) { Offerwall Temp = new Offerwall(); Temp.DisplayName = "CrowdFlower"; Temp.CreditAs = CreditAs.Points; if (AppSettings.Offerwalls.ConvertCrowdflowerToMainBalance) { Temp.CreditAs = CreditAs.MainBalance; } Create(Temp, Username, SentBalance, CalculatedBalance, TrackingInfo, Status); //TODO Crowdflower Points Locking }
private View GetViewContent(Offerwall offer, Member User) { View view = new View(); Literal pre = new Literal(); Literal post = new Literal(); Literal content = new Literal(); pre.Text = "<div class=\"TitanViewElement NewTitanViewElement\"><br /><br />"; post.Text = "</div>"; content.Text = offer.ToClientHTML(User); view.Controls.AddAt(0, pre); view.Controls.AddAt(1, content); view.Controls.AddAt(2, post); return(view); }
public static OfferwallsLog Create(Offerwall Wall, string Username, Money SentBalance, Money CalculatedBalance, string TrackingInfo, OfferwallsLogStatus Status) { if (TrackingInfo == null) { TrackingInfo = "?"; } string sent = "-"; string credited = "-"; if (Wall.CreditAs == CreditAs.Points) { sent = SentBalance.GetRealTotals().ToString(); if (CalculatedBalance != null) { credited = CalculatedBalance.GetRealTotals().ToString() + " " + AppSettings.PointsName; } } if (Wall.CreditAs == CreditAs.MainBalance) { sent = SentBalance.ToClearString(); if (CalculatedBalance != null) { credited = CalculatedBalance.ToString(); } } OfferwallsLog ol = new OfferwallsLog(); ol.Date = DateTime.Now; ol.NetworkName = Wall.DisplayName; ol.SentBalance = sent; ol.Status = Status; ol.SentBalanceMoney = SentBalance; ol.TrackingID = TrackingInfo; ol.Username = Username; ol.CalculatedBalance = credited; ol.Save(); return(ol); }
public static void Release(OfferwallsLog log) { try { Offerwall Wall = TableHelper.SelectRows <Offerwall>(TableHelper.MakeDictionary("DisplayName", log.NetworkName))[0]; //Credit OfferwallCrediter Crediter = new OfferwallCrediter(new Member(log.Username), Wall); Crediter.CreditMember(log.SentBalanceMoney, Wall); //Update log log.Status = OfferwallsLogStatus.CreditedByOfferwallPointsUnlocked; log.Save(); } catch (Exception ex) { ErrorLogger.Log(ex); } }
public static bool OfferwallShouldBeLocked(Money money, Member member, Offerwall Wall) { money = OfferwallCrediter.CalculatedAndConversion(money, member, Wall); return(PointsLockingManager.ShouldBeLocked(money, Wall.CreditAs, member, Wall.RequiresConversion)); }