当前位置: 首页>>代码示例>>C#>>正文


C# UserLoginService.GetByConfirmationCode方法代码示例

本文整理汇总了C#中Rock.Model.UserLoginService.GetByConfirmationCode方法的典型用法代码示例。如果您正苦于以下问题:C# UserLoginService.GetByConfirmationCode方法的具体用法?C# UserLoginService.GetByConfirmationCode怎么用?C# UserLoginService.GetByConfirmationCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rock.Model.UserLoginService的用法示例。


在下文中一共展示了UserLoginService.GetByConfirmationCode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowResetSuccess

        /// <summary>
        /// Shows the reset success.
        /// </summary>
        private void ShowResetSuccess()
        {
            RockContext rockContext = new RockContext();
            UserLoginService userLoginService = new UserLoginService( rockContext );
            UserLogin user = userLoginService.GetByConfirmationCode( this.ConfirmationCode );

            if ( user != null )
            {
                string caption = GetAttributeValue( "PasswordResetCaption" );
                if ( caption.Contains( "{1}" ) )
                {
                    caption = string.Format( caption, user.Person.FirstName, user.UserName );
                }
                else if ( caption.Contains( "{0}" ) )
                {
                    caption = string.Format( caption, user.Person.FirstName );
                }

                lResetSuccess.Text = caption;

                userLoginService.SetPassword( user, tbPassword.Text );
                user.IsConfirmed = true;
                rockContext.SaveChanges();

                pnlResetSuccess.Visible = true;
            }
            else
            {
                ShowCode();
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:34,代码来源:ConfirmAccount.ascx.cs

示例2: ShowDelete

        /// <summary>
        /// Shows the delete.
        /// </summary>
        private void ShowDelete()
        {
            RockContext rockContext = new RockContext();
            UserLoginService userLoginService = new UserLoginService( rockContext );
            UserLogin user = userLoginService.GetByConfirmationCode( this.ConfirmationCode );

            if ( user != null )
            {
                string caption = GetAttributeValue( "DeleteCaption" );
                if ( caption.Contains( "{0}" ) )
                {
                    caption = string.Format( caption, user.UserName );
                }

                lDelete.Text = caption;

                pnlDelete.Visible = true;
            }
            else
            {
                ShowCode();
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:26,代码来源:ConfirmAccount.ascx.cs

示例3: ShowDeleted

        /// <summary>
        /// Shows the deleted.
        /// </summary>
        private void ShowDeleted()
        {
            RockContext rockContext = new RockContext();
            UserLoginService userLoginService = new UserLoginService( rockContext );
            UserLogin user = userLoginService.GetByConfirmationCode( this.ConfirmationCode );

            if ( user != null )
            {
                if ( CurrentUser != null && CurrentUser.UserName == user.UserName )
                {
                    var transaction = new Rock.Transactions.UserLastActivityTransaction();
                    transaction.UserId = CurrentUser.Id;
                    transaction.LastActivityDate = RockDateTime.Now;
                    transaction.IsOnLine = false;
                    Rock.Transactions.RockQueue.TransactionQueue.Enqueue( transaction );

                    FormsAuthentication.SignOut();
                }

                userLoginService.Delete( user );
                rockContext.SaveChanges();

                pnlDeleted.Visible = true;
            }
            else
            {
                ShowCode();
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:32,代码来源:ConfirmAccount.ascx.cs

示例4: ShowResetSuccess

        /// <summary>
        /// Shows the reset success.
        /// </summary>
        private void ShowResetSuccess()
        {
            RockContext rockContext = new RockContext();
            UserLoginService userLoginService = new UserLoginService( rockContext );
            UserLogin user = userLoginService.GetByConfirmationCode( this.ConfirmationCode );

            if ( user != null )
            {
                if ( UserLoginService.IsPasswordValid( tbPassword.Text ) )
                {
                    string caption = GetAttributeValue( "PasswordResetCaption" );
                    if ( caption.Contains( "{1}" ) )
                    {
                        caption = string.Format( caption, user.Person.FirstName, user.UserName );
                    }
                    else if ( caption.Contains( "{0}" ) )
                    {
                        caption = string.Format( caption, user.Person.FirstName );
                    }

                    lResetSuccess.Text = caption;

                    userLoginService.SetPassword( user, tbPassword.Text );
                    user.IsConfirmed = true;
                    rockContext.SaveChanges();

                    pnlResetSuccess.Visible = true;
                }
                else
                {
                    nbMessage.NotificationBoxType = Rock.Web.UI.Controls.NotificationBoxType.Danger;
                    nbMessage.Text = UserLoginService.FriendlyPasswordRules();
                    nbMessage.Visible = true;
                    ShowResetPassword();
                }
            }
            else
            {
                ShowCode();
            }
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:44,代码来源:ConfirmAccount.ascx.cs


注:本文中的Rock.Model.UserLoginService.GetByConfirmationCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。