本文整理汇总了C#中Rock.Model.GroupMemberService.GetByUrlEncodedKey方法的典型用法代码示例。如果您正苦于以下问题:C# GroupMemberService.GetByUrlEncodedKey方法的具体用法?C# GroupMemberService.GetByUrlEncodedKey怎么用?C# GroupMemberService.GetByUrlEncodedKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.GroupMemberService
的用法示例。
在下文中一共展示了GroupMemberService.GetByUrlEncodedKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnInit
/// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
protected override void OnInit( EventArgs e )
{
base.OnInit( e );
try
{
string groupMemberKey = PageParameter( "gm" );
if ( string.IsNullOrWhiteSpace( groupMemberKey ) )
{
ShowError( "Missing Parameter Value" );
}
else
{
var groupMemberService = new GroupMemberService();
var groupMember = groupMemberService.GetByUrlEncodedKey( PageParameter( "gm" ) );
if ( groupMember == null )
{
ShowError();
}
else
{
groupMember.GroupMemberStatus = GroupMemberStatus.Active;
groupMemberService.Save( groupMember, CurrentPersonId );
nbMessage.NotificationBoxType = NotificationBoxType.Success;
nbMessage.Title = "Success";
nbMessage.Text = GetAttributeValue( "SuccessMessage" );
}
}
}
catch (SystemException ex)
{
ShowError( ex.Message );
}
}