本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}