Class FinDtaBuilder

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

Simple utility class for easy building of German DTA files and records.

public class FinDtaBuilder : FinDtaBase
Inheritance
FinDtaBuilder
Inherited Members

Constructors

FinDtaBuilder(int, int, bool)

Contructs a FinDtaBuilder instance with a suggested initial capacity.

public FinDtaBuilder(int nCapacity, int nHandbookVersion, bool fWithUmlaut)

Parameters

nCapacity int

The suggested initial capacity. This should be chosen according to the expected resulting data size.

nHandbookVersion int

Obsolete and ignored.

fWithUmlaut bool

If true, then Umlaut characters are encoded as required for DTAUS files. If false, then Umlaut characters are converted as required for DTAZV files.

Exceptions

ArgumentOutOfRangeException

The parameter nCapacity or nHandbookVersion is less than zero.

Properties

Size

Provides the byte size of the DTA data collected so far.

public int Size { get; }

Property Value

int

Methods

AppendRecordA(FinAcct, DtausType, DateTime, string, DateTime)

public void AppendRecordA(FinAcct aOrderingCustAcct, FinDtaBase.DtausType nDtausType, DateTime tBuildDate, string sReferenceNo, DateTime tScheduleDate)

Parameters

aOrderingCustAcct FinAcct

The ordering customer account that is submitting the generated DTAUS file. The property HolderName may contain the account holder name to be inserted into the DTAUS record A. If it is not provided, then UNBEKANNT will be used as the ordering customer name.

nDtausType FinDtaBase.DtausType

The type of DTAUS file to generate.

tBuildDate DateTime
sReferenceNo string

Optional reference number to be included. Must consist of digits only and must not be longer than 10 characters. May be null. This will be written as field A10 of the DTAUS record A data.

tScheduleDate DateTime

Schduled execution date. For immediate execution the exact same value as the tBuildDate shall be given.

AppendRecordC(FinRemitt, string)

public void AppendRecordC(FinRemitt aRemitt, string sCustNumber)

Parameters

aRemitt FinRemitt

Complete remittance data. Must include a holder name of the ordering customer account.

sCustNumber string

The complete optional customer number for field C6. This may only contain digits and must not be longer than 13 characters. May be null if not needed.

Remarks

If the parameter sCustNumber is null, then the new property DtausCustNumber will be used to set the field C6. If this property is null, too, then field C6 will contain all zeroes.

AppendRecordE()

Adds the final DTAUS record E.

public void AppendRecordE()

Remarks

The required check values are taken from the current values of the properties TotalValue, TotalCount, AcctNoSum, and BankCodeSum.

AppendRecordQ(FinAcct, SwiftTextLines, DateTime, int, DateTime)

Appends a complete DTAZV record Q to this DTA data buffer.

public void AppendRecordQ(FinAcct aOrderingCustAcct, SwiftTextLines aOrderingCustName, DateTime tBuildDate, int nDailySeqNo, DateTime tScheduleDate)

Parameters

aOrderingCustAcct FinAcct

The ordering customer account for which the DTAZV is built.

aOrderingCustName SwiftTextLines

The name of the ordering customer, perhaps including the address in additional lines. This must not be null or an empty string. Use the constant Subsembly.FinTS.FinDtaBuilder.UNKNOWN if not known.

tBuildDate DateTime
nDailySeqNo int
tScheduleDate DateTime

Exceptions

ArgumentNullException

The parameter aOrderingCustAcct or sOrderingCustName was null.

ArgumentException

The parameter sOrderingCustName was an empty string, or a required property of the given aOrderingCustAcct was not set.

AppendRecordT(FinIntRemitt, DateTime)

Appends a complete DTAZV record T for a simple international remittance.

public void AppendRecordT(FinIntRemitt aRemitt, DateTime tScheduleDate)

Parameters

aRemitt FinIntRemitt

International remittance data. This must contain valid data, e.g. IsValid must be true.

tScheduleDate DateTime

Exceptions

ArgumentNullException

The parameter aRemitt was null.

ArgumentException

The given FinIntRemitt was not a valid.

AppendRecordZ()

Adds the final DTAZV record Z.

public void AppendRecordZ()

Remarks

The required check values are taken from the current values of the properties TotalValue and TotalCount.

GenerateDTAUS(FinRemitt, DtausType)

Generates a complete DTAUS from a single remittance.

public static FinDtaBuilder GenerateDTAUS(FinRemitt aRemitt, FinDtaBase.DtausType nDtausType)

Parameters

aRemitt FinRemitt

Complete remittance data. Must include a holder name of the ordering customer account. It also supplies the reference number for field A10 through its DtausReferenceNumber property.

nDtausType FinDtaBase.DtausType

The type of DTAUS file to generate.

Returns

FinDtaBuilder

GenerateDTAUS(FinRemitt[], DtausType, DateTime)

Generates a complete DTAUS.

public static FinDtaBuilder GenerateDTAUS(FinRemitt[] vRemitts, FinDtaBase.DtausType nDtausType, DateTime tScheduleDate)

Parameters

vRemitts FinRemitt[]

Array of FinRemitt instances that provide the data for the C records of the DTAUS. All remittances must have the same OrderingCustAcct. The first remittance also supplies the reference number for field A10 through its DtausReferenceNumber property.

nDtausType FinDtaBase.DtausType
tScheduleDate DateTime

The schedule date to indicate in record A.

Returns

FinDtaBuilder

Remarks

This method creates a single logical file with a single A record, followed by multiple C records and a final E record.

GenerateDTAZV(FinIntRemitt, DateTime, int)

Generates a complete DTAZV from a single international remittance.

public static FinDtaBuilder GenerateDTAZV(FinIntRemitt aRemitt, DateTime tScheduleDate, int nDailySeqNo)

Parameters

aRemitt FinIntRemitt

The international remittance data to generate a DTAZV from.

tScheduleDate DateTime

The schedule date of the international remittance.

nDailySeqNo int

The daily sequence number to put into field Q7. This must be in the range from zero to 99.

Returns

FinDtaBuilder

A new FinDtaBuilder instance that holds the complete DTAZV including a header record Q, a single remittance record T, and a final record Z. The returned DTAZV will not contain notification records.

Exceptions

ArgumentNullException

The parameter aRemitt was null.

GenerateDTAZV(FinIntRemitt, int)

Generates a complete DTAZV from a single international remittance.

public static FinDtaBuilder GenerateDTAZV(FinIntRemitt aRemitt, int nDailySeqNo)

Parameters

aRemitt FinIntRemitt

The international remittance data to generate a DTAZV from.

nDailySeqNo int

The daily sequence number to put into field Q7. This must be in the range from zero to 99.

Returns

FinDtaBuilder

A new FinDtaBuilder instance that holds the complete DTAZV including a header record Q, a single remittance record T, and a final record Z. The returned DTAZV will not contain notification records.

Exceptions

ArgumentNullException

The parameter aRemitt was null.

GenerateDTAZV(FinIntRemitt[], DateTime, int)

Generates a complete DTAZV from multiple international remittance.

public static FinDtaBuilder GenerateDTAZV(FinIntRemitt[] vRemitts, DateTime tScheduleDate, int nDailySeqNo)

Parameters

vRemitts FinIntRemitt[]

The data of at least one international remittance.

tScheduleDate DateTime

The schedule date of the international remittance.

nDailySeqNo int

The daily sequence number to put into field Q7. This must be in the range from zero to 99.

Returns

FinDtaBuilder

A new FinDtaBuilder instance that holds the complete DTAZV including a header record Q, at least one remittance record T, and a final record Z. The returned DTAZV will not contain notification records.

Exceptions

ArgumentNullException

The parameter vRemitts was null.

ArgumentException

vRemitts was an empty array.

ArgumentException

One of the elements of vRemitts was null.

ToBytes()

Convert the collected DTA data to a byte array.

public byte[] ToBytes()

Returns

byte[]

This method returns the complete collected data as a DTA conforming byte array.

ToString()

public override string ToString()

Returns

string

WriteDTAUS(string, FinRemitt[], DtausType, DateTime)

Creates or overwrites a file with a DTAUS file.

public static void WriteDTAUS(string sFileName, FinRemitt[] vRemitts, FinDtaBase.DtausType nDtausType, DateTime tScheduleDate)

Parameters

sFileName string

THe file to create or overwrite.

vRemitts FinRemitt[]

Array of FinRemitt instances that provide the data for the C records of the file. All remittances must have the same OrderingCustAcct.

nDtausType FinDtaBase.DtausType
tScheduleDate DateTime

The schedule date to indicate in record A.

Remarks

This method creates a single logical file with a single A record, followed by multiple C records and a final E record.