本文整理汇总了C#中FinancialAccountService.Select方法的典型用法代码示例。如果您正苦于以下问题:C# FinancialAccountService.Select方法的具体用法?C# FinancialAccountService.Select怎么用?C# FinancialAccountService.Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FinancialAccountService
的用法示例。
在下文中一共展示了FinancialAccountService.Select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="entityType">Type of the entity.</param>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Type entityType, Control[] controls )
{
var accountIdList = ( controls[0] as AccountPicker ).SelectedValuesAsInt().ToList();
string accountGuids = string.Empty;
var accounts = new FinancialAccountService( new RockContext() ).GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
accountGuids = accounts.Select( a => a.Guid ).ToList().AsDelimited( "," );
}
DateRangePicker dateRangePicker = controls[1] as DateRangePicker;
return string.Format( "{0}|{1}|{2}", dateRangePicker.LowerValue, dateRangePicker.UpperValue, accountGuids );
}
示例2: GetEditValue
/// <summary>
/// Reads new values entered by the user for the field
/// </summary>
/// <param name="control">Parent control that controls were added to in the CreateEditControl() method</param>
/// <param name="configurationValues">The configuration values.</param>
/// <returns></returns>
public override string GetEditValue( Control control, Dictionary<string, ConfigurationValue> configurationValues )
{
var picker = control as AccountPicker;
string result = null;
if ( picker != null )
{
var guids = new List<Guid>();
var ids = picker.SelectedValuesAsInt();
var accounts = new FinancialAccountService().Queryable().Where( a => ids.Contains( a.Id ) );
if ( accounts.Any() )
{
guids = accounts.Select( a => a.Guid ).ToList();
}
result = string.Join( ",", guids );
}
return result;
}
示例3: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Control[] controls )
{
string comparisonType = ( (DropDownList)controls[0] ).SelectedValue;
decimal? amount = ( controls[1] as NumberBox ).Text.AsDecimal();
var accountIdList = ( controls[2] as AccountPicker ).SelectedValuesAsInt().ToList();
string accountGuids = string.Empty;
var accounts = new FinancialAccountService( new RockContext() ).GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
accountGuids = accounts.Select( a => a.Guid ).ToList().AsDelimited( "," );
}
DateRangePicker dateRangePicker = controls[3] as DateRangePicker;
RockCheckBox cbCombineGiving = controls[4] as RockCheckBox;
return string.Format( "{0}|{1}|{2}|{3}|{4}|{5}", comparisonType, amount, dateRangePicker.LowerValue, dateRangePicker.UpperValue, accountGuids, cbCombineGiving.Checked );
}
示例4: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Control[] controls )
{
string comparisonType = ( (DropDownList)controls[0] ).SelectedValue;
decimal? amount = ( controls[1] as NumberBox ).Text.AsDecimal();
var accountIdList = ( controls[2] as AccountPicker ).SelectedValuesAsInt().ToList();
string accountGuids = string.Empty;
var accounts = new FinancialAccountService( new RockContext() ).GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
accountGuids = accounts.Select( a => a.Guid ).ToList().AsDelimited( "," );
}
SlidingDateRangePicker slidingDateRangePicker = controls[3] as SlidingDateRangePicker;
// convert pipe to comma delimited
var delimitedValues = slidingDateRangePicker.DelimitedValues.Replace( "|", "," );
RockCheckBox cbCombineGiving = controls[4] as RockCheckBox;
// {2} and {3} used to store the DateRange before, but now we using the SlidingDateRangePicker
return string.Format( "{0}|{1}|{2}|{3}|{4}|{5}|{6}", comparisonType, amount, string.Empty, string.Empty, accountGuids, cbCombineGiving.Checked, delimitedValues );
}
示例5: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( System.Web.UI.Control[] controls )
{
if ( controls.Count() == 1 )
{
AccountPicker accountPicker = controls[0] as AccountPicker;
if ( accountPicker != null )
{
var accountIds = accountPicker.SelectedValues.AsIntegerList();
var accountGuids = new FinancialAccountService( new RockContext() ).GetByIds( accountIds ).Select( a => a.Guid );
return accountGuids.Select( a => a.ToString() ).ToList().AsDelimited( "," );
}
}
return null;
}
示例6: GetSelection
/// <summary>
/// Gets the selection.
/// </summary>
/// <param name="entityType">Type of the entity.</param>
/// <param name="controls">The controls.</param>
/// <returns></returns>
public override string GetSelection( Type entityType, Control[] controls )
{
var accountIdList = ( controls[0] as AccountPicker ).SelectedValuesAsInt().ToList();
string accountGuids = string.Empty;
var accounts = new FinancialAccountService( new RockContext() ).GetByIds( accountIdList );
if ( accounts != null && accounts.Any() )
{
accountGuids = accounts.Select( a => a.Guid ).ToList().AsDelimited( "," );
}
SlidingDateRangePicker slidingDateRangePicker = controls[1] as SlidingDateRangePicker;
// convert pipe to comma delimited
var delimitedValues = slidingDateRangePicker.DelimitedValues.Replace( "|", "," );
// {1} and {2} used to store the DateRange before, but now we using the SlidingDateRangePicker
return string.Format( "{0}|{1}|{2}|{3}", string.Empty, string.Empty, accountGuids, delimitedValues );
}