Class FinDtaBuilder
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
nCapacityintThe suggested initial capacity. This should be chosen according to the expected resulting data size.
nHandbookVersionintObsolete and ignored.
fWithUmlautboolIf
true, then Umlaut characters are encoded as required for DTAUS files. Iffalse, 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
Methods
AppendRecordA(FinAcct, DtausType, DateTime, string, DateTime)
public void AppendRecordA(FinAcct aOrderingCustAcct, FinDtaBase.DtausType nDtausType, DateTime tBuildDate, string sReferenceNo, DateTime tScheduleDate)
Parameters
aOrderingCustAcctFinAcctThe 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.
nDtausTypeFinDtaBase.DtausTypeThe type of DTAUS file to generate.
tBuildDateDateTimesReferenceNostringOptional 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.tScheduleDateDateTimeSchduled 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
aRemittFinRemittComplete remittance data. Must include a holder name of the ordering customer account.
sCustNumberstringThe complete optional customer number for field C6. This may only contain digits and must not be longer than 13 characters. May be
nullif 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
aOrderingCustAcctFinAcctThe ordering customer account for which the DTAZV is built.
aOrderingCustNameSwiftTextLinesThe name of the ordering customer, perhaps including the address in additional lines. This must not be
nullor an empty string. Use the constant Subsembly.FinTS.FinDtaBuilder.UNKNOWN if not known.tBuildDateDateTimenDailySeqNointtScheduleDateDateTime
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
aRemittFinIntRemittInternational remittance data. This must contain valid data, e.g. IsValid must be
true.tScheduleDateDateTime
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
aRemittFinRemittComplete 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.
nDtausTypeFinDtaBase.DtausTypeThe type of DTAUS file to generate.
Returns
GenerateDTAUS(FinRemitt[], DtausType, DateTime)
Generates a complete DTAUS.
public static FinDtaBuilder GenerateDTAUS(FinRemitt[] vRemitts, FinDtaBase.DtausType nDtausType, DateTime tScheduleDate)
Parameters
vRemittsFinRemitt[]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.
nDtausTypeFinDtaBase.DtausTypetScheduleDateDateTimeThe schedule date to indicate in record A.
Returns
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
aRemittFinIntRemittThe international remittance data to generate a DTAZV from.
tScheduleDateDateTimeThe schedule date of the international remittance.
nDailySeqNointThe 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
aRemittFinIntRemittThe international remittance data to generate a DTAZV from.
nDailySeqNointThe 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
vRemittsFinIntRemitt[]The data of at least one international remittance.
tScheduleDateDateTimeThe schedule date of the international remittance.
nDailySeqNointThe 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
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
sFileNamestringTHe file to create or overwrite.
vRemittsFinRemitt[]Array of FinRemitt instances that provide the data for the C records of the file. All remittances must have the same OrderingCustAcct.
nDtausTypeFinDtaBase.DtausTypetScheduleDateDateTimeThe 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.