private static Dictionary<string, object> GetGivingAnalyticsParameters( DateTime? start, DateTime? end, decimal? minAmount, decimal? maxAmount,
List<int> accountIds, List<int> currencyTypeIds, List<int> sourceTypeIds )
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
if ( start.HasValue )
{
parameters.Add( "StartDate", start.Value );
}
if ( end.HasValue )
{
parameters.Add( "EndDate", end.Value );
}
if ( minAmount.HasValue )
{
parameters.Add( "MinAmount", minAmount.Value );
}
if ( maxAmount.HasValue )
{
parameters.Add( "MaxAmount", maxAmount.Value );
}
if ( accountIds != null && accountIds.Any() )
{
parameters.Add( "AccountIds", accountIds.AsDelimited(",") );
}
if ( currencyTypeIds != null && currencyTypeIds.Any() )
{
parameters.Add( "CurrencyTypeIds", currencyTypeIds.AsDelimited(",") );
}
if ( sourceTypeIds != null && sourceTypeIds.Any() )
{
parameters.Add( "SourceTypeIds", sourceTypeIds.AsDelimited(",") );
}
return parameters;
}