Class SepaAmount

Namespace
Subsembly.Sepa
Assembly
Subsembly.Sepa.dll
public sealed class SepaAmount : SepaObject
Inheritance
SepaAmount
Inherited Members

Constructors

SepaAmount()

The default constructor creates an element with TagName "Amt", SepaAmountCreditDebitIndicatorConstraint Optional, and IsMandatory as false.

public SepaAmount()

SepaAmount(string, SepaAmountCreditDebitIndicatorConstraint)

public SepaAmount(string sTagName, SepaAmountCreditDebitIndicatorConstraint nCdtDbtIndConstraint)

Parameters

sTagName string
nCdtDbtIndConstraint SepaAmountCreditDebitIndicatorConstraint

SepaAmount(string, SepaAmountCreditDebitIndicatorConstraint, bool)

public SepaAmount(string sTagName, SepaAmountCreditDebitIndicatorConstraint nCdtDbtIndConstraint, bool fIsMandatory)

Parameters

sTagName string

The XML tag that shall be used for writing the amount element. Usually this is "Amt", but can be different.

nCdtDbtIndConstraint SepaAmountCreditDebitIndicatorConstraint

Indicates whether the CreditDebitIndicator must be set to either Credit or Debit for a valid amount.

fIsMandatory bool

Fields

CRDT

The CreditDebitIndicatorCode for credits (positive amounts).

public const string CRDT = "CRDT"

Field Value

string

DBIT

The CreditDebitIndicatorCode for debits (negative amounts).

public const string DBIT = "DBIT"

Field Value

string

Properties

Amount

The decimal amount.

public decimal Amount { get; set; }

Property Value

decimal

For SEPA payments the value must be in the range from 0.00 through 999,999,999.99. The initial value is zero.

Exceptions

ArgumentOutOfRangeException

An attempt was made to set a negative value.

CreditDebitIndicator

Credit debit indicator of the amount.

public SepaCreditDebitIndicator CreditDebitIndicator { get; set; }

Property Value

SepaCreditDebitIndicator

Remarks

The value Undefined indicates that no credit debit indicator was given. The initial value of this property is Undefined. Whenever this is set to either Credit or Debit, then a CdtDbtInd XML element will be written.

Exceptions

InvalidOperationException

Is thrown if this method is invoked on an instance that does not support the CreditDebitIndicator.

See Also

CreditDebitIndicatorCode

Credit debit indicator as a four letter code string.

public string CreditDebitIndicatorCode { get; set; }

Property Value

string

This is "CRDT" for Credit, "DBIT" for Debit, or null for Undefined. Setting an empty string will also set the CreditDebitIndicator to Undefined.

Exceptions

ArgumentException

An attempt was made to set a string value that was neither "CRDT" nor "DBIT".

InvalidOperationException

Is thrown if this method is invoked on an instance that does not support the CreditDebitIndicator.

See Also

Currency

The currency code of the amount. According to the XSD the use of this attribute is required.

public string Currency { get; set; }

Property Value

string

The initial value of this property is null. It is possible to set this property to null if you want to just reset this amount.

Exceptions

ArgumentException

An attempt was made to set a value that is not a syntactically valid currency code.

IsDebit

Convenience property that indicates whether CreditDebitIndicator is Debit.

public bool IsDebit { get; }

Property Value

bool

IsEmpty

public override bool IsEmpty { get; }

Property Value

bool

Value

Provides the signed value of the amount.

public decimal Value { get; }

Property Value

decimal

If the CreditDebitIndicator is Debit, then minus Amount is provided. In any other case simply the Amount is provided.

Methods

Clear()

public override void Clear()

Clone()

public SepaAmount Clone()

Returns

SepaAmount

OnReadObjectXml(XmlReader, SepaMessageInfo, string)

protected override bool OnReadObjectXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo, string sTagName)

Parameters

aXmlReader XmlReader
aMessageInfo SepaMessageInfo
sTagName string

Returns

bool

Exceptions

SepaException

OnReadXml(XmlReader, SepaMessageInfo)

protected override void OnReadXml(XmlReader aXmlReader, SepaMessageInfo aMessageInfo)

Parameters

aXmlReader XmlReader
aMessageInfo SepaMessageInfo

Exceptions

NotImplementedException

OnValidate(ICollection<SepaException>, string)

protected override void OnValidate(ICollection<SepaException> vErrors, string sPath)

Parameters

vErrors ICollection<SepaException>
sPath string

OnWriteObjectXml(XmlWriter, SepaMessageInfo, string)

protected override void OnWriteObjectXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo, string sTagName)

Parameters

aXmlWriter XmlWriter
aMessageInfo SepaMessageInfo
sTagName string

OnWriteXml(XmlWriter, SepaMessageInfo)

protected override void OnWriteXml(XmlWriter aXmlWriter, SepaMessageInfo aMessageInfo)

Parameters

aXmlWriter XmlWriter
aMessageInfo SepaMessageInfo

Exceptions

NotImplementedException

SetValue(decimal)

Sets the Amount and CreditDebitIndicator from a signed decimal value.

public void SetValue(decimal nValue)

Parameters

nValue decimal

Signed decimal value. The Amount will be set to the unsigned absolute amount of this value.

Remarks

If this instance does support the CreditDebitIndicator, then this method will update it according to the sign of the value. If the value is negative, then the CreditDebitIndicator will be set to Debit. If the value is zero or positive, then then the CreditDebitIndicator will be set to Credit.

See Also

ToString()

public override string ToString()

Returns

string