public FinancialBatch Get( string namePrefix, string nameSuffix, DefinedValueCache currencyType, DefinedValueCache creditCardType,
DateTime transactionDate, TimeSpan batchTimeOffset, List<FinancialBatch> batches = null )
{
// Use the credit card type's batch name suffix, or if that doesn't exist, use the currency type value
string ccSuffix = string.Empty;
if (creditCardType != null )
{
ccSuffix = creditCardType.GetAttributeValue( "BatchNameSuffix" );
if ( string.IsNullOrWhiteSpace( ccSuffix ) )
{
ccSuffix = creditCardType.Value;
}
}
if ( string.IsNullOrWhiteSpace( ccSuffix ) && currencyType != null )
{
ccSuffix = currencyType.Value;
}
string batchName = namePrefix.Trim() + ( string.IsNullOrWhiteSpace( ccSuffix ) ? "" : " " + ccSuffix ) + nameSuffix;
return GetByNameAndDate( batchName, transactionDate, batchTimeOffset, batches );
}