Struct SepaVatID

Namespace
Subsembly.Sepa
Assembly
Subsembly.Sepa.dll
public struct SepaVatID
Inherited Members

Constructors

SepaVatID(string)

public SepaVatID(string sVatID)

Parameters

sVatID string

Fields

MAXLENGTH

The maximum length of a valid VAT ID.

public const int MAXLENGTH = 14

Field Value

int

MINLENGTH

The minimum length of a valid VAT ID.

public const int MINLENGTH = 4

Field Value

int

NullVatID

A null VAT ID.

public static readonly SepaVatID NullVatID

Field Value

SepaVatID

Properties

CountryCode

The country code of the issuing country.

public string CountryCode { get; }

Property Value

string

Remarks

If this is a NullVatID, then null is returned.

If the VAT ID uses the country code "XI" for Northern Ireland, then "GB" will be returned. If the VAT ID uses the country code "EL" for Greece, then "GR" will be returned. ///

IsNull

Indicates whether this SepaVatID is a NullVatID.

public bool IsNull { get; }

Property Value

bool

VatID

public string VatID { get; }

Property Value

string

Methods

Equals(object)

Compares the SepaVatID for equivalence.

public override bool Equals(object obj)

Parameters

obj object

Right hand side to compare to.

Returns

bool

True if both are the same SepaVatID.

GetCountryCode(string)

If the given VAT ID is valid, then the country code of the issuing country is returned.

public static string GetCountryCode(string sVatID)

Parameters

sVatID string

Returns

string

Remarks

If the VAT ID uses the country code "XI" for Northern Ireland, then "GB" will be returned. If the VAT ID uses the country code "EL" for Greece, then "GR" will be returned.

GetHashCode()

Provides a hash code for this SepaVatID.

public override int GetHashCode()

Returns

int

Hashcode.

IsValid(string)

public static bool IsValid(string sVatID)

Parameters

sVatID string

A strictly formatted VAT ID. If this is null or an empty string, then false is returned.

Returns

bool

If a syntactically valid VAT ID was given, then true is returned. Otherwise, false is returned.

ToString()

public override string ToString()

Returns

string

TryCapture(string)

Try to capture a user entered VAT ID.

public static SepaVatID TryCapture(string sPaperVatID)

Parameters

sPaperVatID string

A string that represents a VAT ID that was manually entered by an user. It may contain blanks and may use lower case letters. If this is null or an empty string, then NullVatID is returned.

Returns

SepaVatID

Remarks

Any non alphanumeric characters, such as whitespace or symbols, are removed from the captured VAT ID.

Any lower case letters are converted into upper case letters.

Operators

operator ==(SepaVatID, SepaVatID)

public static bool operator ==(SepaVatID lhs, SepaVatID rhs)

Parameters

lhs SepaVatID
rhs SepaVatID

Returns

bool

operator !=(SepaVatID, SepaVatID)

public static bool operator !=(SepaVatID lhs, SepaVatID rhs)

Parameters

lhs SepaVatID
rhs SepaVatID

Returns

bool