//GAC:Microsoft.CSharp.dll,System.IO.dll
using Kofax.KCS.ImportConnector.Messages;
using Kofax.KCS.ImportConnector.Scripting;
using System.IO;
namespace Kofax.KCS.ImportConnector.ScriptingSample
{
/// <summary>
/// Batch Naming class for use at Capita.
/// </summary>
/// <remarks>Copyright Scansation Ltd. 2017</remarks>
public class CapitaBatchNaming : IBatchNameFormatter
{
/// <summary>
/// Get the name of the Capita batch.
/// </summary>
/// <param name="msg">ReadonlyMessage objects in batch.</param>
/// <returns>Generated name for the batch.</returns>
public string GetBatchName(ReadonlyMessage[] msg)
{
// Only look at the first message, as hopefully it'll be sufficient for our needs.
ReadonlyMessage message = msg[0];
string routingNumber = message.Fields["KfxRoutingNumber"];
string batchName = Path.GetFileNameWithoutExtension(routingNumber);
return batchName;
}
}
}