本文整理汇总了C#中Rock.Model.FinancialTransactionService.Distinct方法的典型用法代码示例。如果您正苦于以下问题:C# FinancialTransactionService.Distinct方法的具体用法?C# FinancialTransactionService.Distinct怎么用?C# FinancialTransactionService.Distinct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rock.Model.FinancialTransactionService
的用法示例。
在下文中一共展示了FinancialTransactionService.Distinct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindSavedAccounts
/// <summary>
/// Binds the saved accounts.
/// </summary>
private void BindSavedAccounts()
{
rblSavedCC.Items.Clear();
if ( TargetPerson != null )
{
// Get the saved accounts for the currently logged in user
var savedAccounts = new FinancialPersonSavedAccountService( new RockContext() )
.GetByPersonId( TargetPerson.Id );
if ( _ccGateway != null )
{
var ccGatewayComponent = _ccGateway.GetGatewayComponent();
var ccCurrencyType = DefinedValueCache.Read( new Guid( Rock.SystemGuid.DefinedValue.CURRENCY_TYPE_CREDIT_CARD ) );
if ( ccGatewayComponent != null && ccGatewayComponent.SupportsSavedAccount( ccCurrencyType ) )
{
rblSavedCC.DataSource = savedAccounts
.Where( a =>
a.FinancialGatewayId == _ccGateway.Id &&
a.FinancialPaymentDetail != null &&
a.FinancialPaymentDetail.CurrencyTypeValueId == ccCurrencyType.Id )
.OrderBy( a => a.Name )
.Select( a => new
{
Id = a.Id,
Name = "Use " + a.Name + " (" + a.FinancialPaymentDetail.AccountNumberMasked + ")"
} ).ToList();
rblSavedCC.DataBind();
if ( rblSavedCC.Items.Count > 0 )
{
rblSavedCC.Items.Add( new ListItem( "Use a different card", "0" ) );
CollapseCardData.Value = "true";
}
}
}
if ( _achGateway != null )
{
var achGatewayComponent = _ccGateway.GetGatewayComponent();
var achCurrencyType = DefinedValueCache.Read( new Guid( Rock.SystemGuid.DefinedValue.CURRENCY_TYPE_ACH ) );
if ( achGatewayComponent != null && achGatewayComponent.SupportsSavedAccount( achCurrencyType ) )
{
rblSavedAch.DataSource = savedAccounts
.Where( a =>
a.FinancialGatewayId == _achGateway.Id &&
a.FinancialPaymentDetail != null &&
a.FinancialPaymentDetail.CurrencyTypeValueId == achCurrencyType.Id )
.OrderBy( a => a.Name )
.Select( a => new
{
Id = a.Id,
Name = "Use " + a.Name + " (" + a.FinancialPaymentDetail.AccountNumberMasked + ")"
} ).ToList();
rblSavedAch.DataBind();
}
divRecentCheck.Style[HtmlTextWriterStyle.Display] = "none";
var aliasIds = TargetPerson.Aliases.Select( y => y.Id ).ToList();
var prevChecks = new FinancialTransactionService( new RockContext() ).Queryable().Where( x => aliasIds.Contains( x.AuthorizedPersonAliasId ?? -1 ) ).Where( x => x.CheckMicrParts != null ).SortBy( "CreatedDateTime Desc" ).Take( 3 ).ToList().Select( x => (Rock.Security.Encryption.DecryptString( x.CheckMicrParts ) ?? "").Split( '_' ) ).Select( x => x.ElementAtOrDefault( 0 ) + "_" + x.ElementAtOrDefault( 1 ) );
if ( prevChecks.Distinct().Count() == 1 && prevChecks.FirstOrDefault() != "_" )
{
rblSavedAch.Items.Add( new ListItem( "Use recent check", "-1" ) );
var achDat = prevChecks.FirstOrDefault().Split( '_' );
if ( achDat.Count() == 2 )
{
if ( !IsPostBack )
{
txtCheckRoutingNumber.Text = achDat[0];
txtCheckAccountNumber.Text = achDat[1];
}
}
if ( PageParameter( "flc" ) == "1" && !IsPostBack )
{
hfPaymentTab.Value = "ACH";
rblSavedAch.SelectedValue = "-1";
}
}
if ( rblSavedAch.Items.Count > 0 )
{
rblSavedAch.Items.Add( new ListItem( "Use a different bank account", "0" ) );
CollapseCardData.Value = "true";
}
}
if ( rblSavedCC.Items.Count <= 0 && rblSavedAch.Items.Count > 0 )
{
hfPaymentTab.Value = "ACH";
}
}
}