Exemplo n.º 1
0
        protected void Subscribe_Click(object sender, EventArgs e)
        {
            EPiServerProfile user = EPiServerProfile.Current;

            user.SubscriptionInfo.Interval = Int32.Parse(Interval.SelectedItem.Value);

            if (Email.Enabled)
            {
                user.Email = Email.Text;
            }

            user.Save();
        }
Exemplo n.º 2
0
        /// <summary>Execute subscription job</summary>
        protected virtual string InternalExecute()
        {
            int num1 = 0;
            int num2 = 0;

label_1:
            int totalRecords;
            ProfileInfoCollection allProfiles = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All, num2++, 1000, out totalRecords);

            if (allProfiles.Count == 0)
            {
                return(string.Format("{0} user profiles were found. {1} subscription e-mails were sent.", (object)totalRecords, (object)num1));
            }
            IEnumerator enumerator = allProfiles.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    EPiServerProfile profile = EPiServerProfile.Get(((ProfileInfo)enumerator.Current).UserName);
                    if (!SubscriptionJob.IsInInterval(profile.SubscriptionInfo.Interval, profile.SubscriptionInfo.LastMessage))
                    {
                        int num3 = this.SendSubscriptions(profile);
                        if (num3 >= 0)
                        {
                            profile.SubscriptionInfo.LastMessage = DateTime.Now;
                            num1 += num3;
                            profile.Save();
                        }
                    }
                }
                goto label_1;
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Exemplo n.º 3
0
        protected void Subscribe_Click(object sender, EventArgs e)
        {
            EPiServerProfile user = EPiServerProfile.Current;

            if (Email.Enabled)
            {
                Page.Validate("SubscriptionWizard");
                if (!Page.IsValid)
                {
                    return;
                }

                user.Email = Email.Text;
            }


            user.SubscriptionInfo.Interval = Int32.Parse(Interval.SelectedItem.Value);

            user.Save();
        }