Example #1
0
        public bool VerificateSubscribtionCode(string code)
        {
            var subscriber = this.Subscribers.GetFirstOrNull(s => s.SubscriptionVerificationCode == code && !s.IsActive && !s.IsRemoved);

            if (subscriber == null)
            {
                return(false);
            }

            int passedHours = (DateTime.Now - subscriber.SubscriptionPendingDate).Hours;

            if (passedHours > 24)
            {
                return(false);
            }

            this.currentSubscriberEmail = subscriber.Email;

            string unsubsribeCode = CodeGenerator.GenerateVerificationCode(subscriber.Email);

            subscriber.IsActive                     = true;
            subscriber.SubscriptionDate             = DateTime.Now;
            subscriber.SubscriptionVerificationCode = null;
            subscriber.UnsubscribeVerificationCode  = unsubsribeCode;

            this.Subscribers.Update(subscriber);

            var statIncr = new StatisticsIncrementer(this.Statistics);

            statIncr.IncrementSubscribers();

            return(true);
        }
Example #2
0
        public void VisitsIncrement()
        {
            var statIncr = new StatisticsIncrementer(this.Statistics);

            statIncr.IncrementVistis();
        }