Esempio n. 1
0
    public static void TryAddLinkView(string input)
    {
        if (AppSettings.TitanFeatures.ReferralPoolRotatorEnabled)
        {
            try
            {
                if (!String.IsNullOrEmpty(input) && input.StartsWith("*"))
                {
                    int linkId = Convert.ToInt32(input.Substring(1));
                    PoolRotatorLinkUser link = new PoolRotatorLinkUser(linkId);
                    link.ClicksDelivered++;

                    if (link.ClicksDelivered % 1000 == 0)
                    {
                        Member owner = new Member(link.UserId);
                        owner.AddToPointsBalance(owner.Membership.PointsPer1000viewsDeliveredToPoolRotator, "Rotator Link bonus");
                        owner.SaveBalances();
                    }

                    link.Save();
                }
            }
            catch (Exception ex) { }
        }
    }
Esempio n. 2
0
    public static void AddToPool(int userId)
    {
        PoolRotatorLinkUser linkUser = new PoolRotatorLinkUser();

        linkUser.Expires            = DateTime.Now.AddDays(30);
        linkUser.UserId             = userId;
        linkUser.ReferralsDelivered = 0;
        linkUser.ClicksDelivered    = 0;
        linkUser.IsActive           = true;
        linkUser.Save();
    }