private IEnumerable<Transaction> BaseFilterQuery(GlobalFilterCriteria criteria)
{
if (criteria.Cleared)
{
return AllTransactions.ToList();
}
IEnumerable<Transaction> query = AllTransactions;
if (criteria.BeginDate != null)
{
query = AllTransactions.Where(t => t.Date >= criteria.BeginDate.Value);
}
if (criteria.EndDate != null)
{
query = query.Where(t => t.Date <= criteria.EndDate.Value);
}
return query;
}