Пример #1
0
        public void SaveProfile()
        {
            List <Pair> _properties = new List <Pair>()
            {
                new Pair("DisplayName", txtDisplayName.Text),
                new Pair("Newsletter", chkNewsletter.Checked)
            };
            Pair _propertyKeyValuePair = SueetieUsers.GenerateProfileKeyValues(_properties);

            SueetieUsers.UpdateSueetieUserProfile(_propertyKeyValuePair, sueetieUser.UserID);

            _user.LastActivityDate = lastActivitydate;
            Membership.UpdateUser(_user);
            _user = Membership.GetUser(username, false);
        }
Пример #2
0
        public void SaveProfile()
        {
            if (Page.User.Identity.IsAuthenticated)
            {
                #region Control Value Assignments

                if (HasNewsletterCheckBox)
                {
                    Newsletter = chkNewsletter.Checked;
                }

                #endregion

                List <Pair> _properties = new List <Pair>()
                {
                    new Pair("DisplayName", txtDisplayName.Text),
                    new Pair("Newsletter", Newsletter.ToString())
                };

                Pair _propertyKeyValuePair = SueetieUsers.GenerateProfileKeyValues(_properties);
                SueetieUsers.UpdateSueetieUserProfile(_propertyKeyValuePair, CurrentSueetieUserID);

                MembershipUser user = Membership.GetUser();
                user.Email = txtEmail.Text;
                Membership.UpdateUser(user);

                SueetieUser sueetieUser = new SueetieUser
                {
                    UserName     = CurrentSueetieUser.UserName,
                    UserID       = CurrentSueetieUser.UserID,
                    Email        = txtEmail.Text.ToLower(),
                    DisplayName  = txtDisplayName.Text,
                    IsActive     = true,
                    TimeZone     = Convert.ToInt32(ddTimeZones.SelectedValue),
                    MembershipID = CurrentSueetieUser.MembershipID
                };

                SueetieUsers.UpdateSueetieUser(sueetieUser);
                SueetieUsers.ClearUserProfileCache(CurrentSueetieUser.UserID);
            }
        }