本文整理汇总了C#中FinancialAccountService.GetByIds方法的典型用法代码示例。如果您正苦于以下问题:C# FinancialAccountService.GetByIds方法的具体用法?C# FinancialAccountService.GetByIds怎么用?C# FinancialAccountService.GetByIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FinancialAccountService
的用法示例。
在下文中一共展示了FinancialAccountService.GetByIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: gfTransactions_DisplayFilterValue
/// <summary>
/// Handles the filter display for each saved user value
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
/// <exception cref="System.NotImplementedException"></exception>
protected void gfTransactions_DisplayFilterValue( object sender, Rock.Web.UI.Controls.GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Row Limit":
// row limit filter was removed, so hide it just in case
e.Value = null;
break;
case "Date Range":
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
break;
case "Amount Range":
e.Value = NumberRangeEditor.FormatDelimitedValues( e.Value, "N2" );
break;
case "Account":
var accountIds = e.Value.SplitDelimitedValues().AsIntegerList().Where(a => a > 0 ).ToList();
if ( accountIds.Any())
{
var service = new FinancialAccountService( new RockContext() );
var accountNames = service.GetByIds( accountIds ).OrderBy( a => a.Order ).OrderBy( a => a.Name ).Select( a => a.Name ).ToList().AsDelimited( ", ", " or " );
e.Value = accountNames;
}
else
{
e.Value = string.Empty;
}
break;
case "Transaction Type":
case "Currency Type":
case "Credit Card Type":
case "Source Type":
int definedValueId = 0;
if ( int.TryParse( e.Value, out definedValueId ) )
{
var definedValue = DefinedValueCache.Read( definedValueId );
if ( definedValue != null )
{
e.Value = definedValue.Value;
}
}
break;
case "Campus":
var campus = CampusCache.Read( e.Value.AsInteger() );
if ( campus != null )
{
e.Value = campus.Name;
}
else
{
e.Value = string.Empty;
}
break;
}
}
示例2: BindFilter
/// <summary>
/// Binds the filter.
/// </summary>
private void BindFilter()
{
drpDates.DelimitedValues = gfTransactions.GetUserPreference( "Date Range" );
nreAmount.DelimitedValues = gfTransactions.GetUserPreference( "Amount Range" );
tbTransactionCode.Text = gfTransactions.GetUserPreference( "Transaction Code" );
apAccount.DisplayActiveOnly = GetAttributeValue( "ActiveAccountsOnlyFilter" ).AsBoolean();
var accountIds = ( gfTransactions.GetUserPreference( "Account" ) ?? "" ).SplitDelimitedValues().AsIntegerList().Where( a => a > 0 ).ToList();
if ( accountIds.Any() )
{
var service = new FinancialAccountService( new RockContext() );
var accounts = service.GetByIds( accountIds ).OrderBy( a => a.Order ).OrderBy( a => a.Name ).ToList();
apAccount.SetValues(accounts);
}
else
{
apAccount.SetValue( 0 );
}
BindDefinedTypeDropdown( ddlTransactionType, new Guid( Rock.SystemGuid.DefinedType.FINANCIAL_TRANSACTION_TYPE ), "Transaction Type" );
BindDefinedTypeDropdown( ddlCurrencyType, new Guid( Rock.SystemGuid.DefinedType.FINANCIAL_CURRENCY_TYPE ), "Currency Type" );
BindDefinedTypeDropdown( ddlCreditCardType, new Guid( Rock.SystemGuid.DefinedType.FINANCIAL_CREDIT_CARD_TYPE ), "Credit Card Type" );
BindDefinedTypeDropdown( ddlSourceType, new Guid( Rock.SystemGuid.DefinedType.FINANCIAL_SOURCE_TYPE ), "Source Type" );
if ( this.ContextEntity() == null )
{
var campusi = CampusCache.All();
campCampus.Campuses = campusi;
campCampus.Visible = campusi.Any();
campCampus.SetValue( gfTransactions.GetUserPreference( "Campus" ) );
}
else
{
campCampus.Visible = false;
}
}
示例3: gfPledges_DisplayFilterValue
/// <summary>
/// Gfs the pledges_ display filter value.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
/// <exception cref="System.NotImplementedException"></exception>
protected void gfPledges_DisplayFilterValue( object sender, GridFilter.DisplayFilterValueArgs e )
{
switch ( e.Key )
{
case "Date Range":
if ( drpDates.Visible )
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
}
else
{
e.Value = string.Empty;
}
break;
case "Last Modified":
if ( drpLastModifiedDates.Visible )
{
e.Value = DateRangePicker.FormatDelimitedValues( e.Value );
}
else
{
e.Value = string.Empty;
}
break;
case "Person":
int? personId = e.Value.AsIntegerOrNull();
if ( personId != null && ppFilterPerson.Visible )
{
var person = new PersonService( new RockContext() ).Get( personId.Value );
if ( person != null )
{
e.Value = person.ToString();
}
else
{
e.Value = string.Empty;
}
}
else
{
e.Value = string.Empty;
}
break;
case "Accounts":
var accountIdList = e.Value.Split( ',' ).AsIntegerList();
if ( accountIdList.Any() && apFilterAccount.Visible )
{
var service = new FinancialAccountService( new RockContext() );
var accounts = service.GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
e.Value = accounts.Select( a => a.Name ).ToList().AsDelimited( "," );
}
else
{
e.Value = string.Empty;
}
}
else
{
e.Value = string.Empty;
}
break;
default:
e.Value = string.Empty;
break;
}
}