Struct SepaVatID
public struct SepaVatID
- Inherited Members
Constructors
SepaVatID(string)
public SepaVatID(string sVatID)
Parameters
sVatIDstring
Fields
MAXLENGTH
The maximum length of a valid VAT ID.
public const int MAXLENGTH = 14
Field Value
MINLENGTH
The minimum length of a valid VAT ID.
public const int MINLENGTH = 4
Field Value
NullVatID
A null VAT ID.
public static readonly SepaVatID NullVatID
Field Value
Properties
CountryCode
The country code of the issuing country.
public string CountryCode { get; }
Property Value
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
public bool IsNull { get; }
Property Value
VatID
public string VatID { get; }
Property Value
Methods
Equals(object)
Compares the SepaVatID for equivalence.
public override bool Equals(object obj)
Parameters
objobjectRight hand side to compare to.
Returns
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
sVatIDstring
Returns
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
sVatIDstringA strictly formatted VAT ID. If this is
nullor an empty string, thenfalseis returned.
Returns
- bool
If a syntactically valid VAT ID was given, then
trueis returned. Otherwise,falseis returned.
ToString()
public override string ToString()
Returns
TryCapture(string)
Try to capture a user entered VAT ID.
public static SepaVatID TryCapture(string sPaperVatID)
Parameters
sPaperVatIDstringA 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
nullor an empty string, then NullVatID is returned.
Returns
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
Returns
operator !=(SepaVatID, SepaVatID)
public static bool operator !=(SepaVatID lhs, SepaVatID rhs)