public static DataSet GetPledgeAnalytics( int accountId, DateTime? start, DateTime? end,
decimal? minAmountPledged, decimal? maxAmountPledged, decimal? minComplete, decimal? maxComplete, decimal? minAmountGiven, decimal? maxAmountGiven,
bool includePledges, bool includeGifts )
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add( "AccountId", accountId );
if ( start.HasValue )
{
parameters.Add( "StartDate", start.Value );
}
if ( end.HasValue )
{
parameters.Add( "EndDate", end.Value );
}
if ( minAmountPledged.HasValue )
{
parameters.Add( "MinAmountPledged", minAmountPledged.Value );
}
if ( maxAmountPledged.HasValue )
{
parameters.Add( "MaxAmountPledged", maxAmountPledged.Value );
}
if ( minComplete.HasValue )
{
parameters.Add( "MinComplete", minComplete.Value / 100 );
}
if ( maxComplete.HasValue )
{
parameters.Add( "MaxComplete", maxComplete.Value / 100 );
}
if ( minAmountGiven.HasValue )
{
parameters.Add( "MinAmountGiven", minAmountGiven.Value );
}
if ( maxAmountGiven.HasValue )
{
parameters.Add( "MaxAmountGiven", maxAmountGiven.Value );
}
parameters.Add( "IncludePledges", includePledges );
parameters.Add( "IncludeGifts", includeGifts );
var result = DbService.GetDataSet( "spFinance_PledgeAnalyticsQuery", System.Data.CommandType.StoredProcedure, parameters, 180 );
return result;
}