Class CountryCache
Inherited Members
Namespace: SuperOffice.CRM.Globalization
Assembly: SoDataBase.dll
Syntax
[CacheV2("Database", 0)]
public class CountryCache : CacheBaseV2, IFlushableV2, IDisposable
Constructors
CountryCache()
Declaration
public CountryCache()
Properties
TableNames
Gets the names of the table data that are cached in this cache. When these tables are updated the cache will be disposed so a new cache instance can take its place.
Declaration
protected override IEnumerable<string> TableNames { get; }
Property Value
Type | Description |
---|---|
IEnumerable<string> |
Overrides
Methods
GetCountryIds()
Get all country ids
Declaration
public int[] GetCountryIds()
Returns
Type | Description |
---|---|
int[] | List of all country ids |
GetCurrent()
Get the current instance of the CountryCache
Declaration
public static CountryCache GetCurrent()
Returns
Type | Description |
---|---|
CountryCache | Current instance of the country cache. |
GetFromCountryName(string)
Get a the Country information object from its name. The name can be exact or partial match.
Declaration
public Country GetFromCountryName(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the country: "norge", "Norge" or "NORGE" |
Returns
Type | Description |
---|---|
Country | The Country information object, or null if not found |
GetFromId(int)
Get the Country information object from the countries primary key (this is no longer the phone prefix).
Declaration
public Country GetFromId(int countryId)
Parameters
Type | Name | Description |
---|---|---|
int | countryId | Countries primary key (this is no longer the phone prefix) |
Returns
Type | Description |
---|---|
Country | The Country information object |
GetFromIso(string)
Get a the Country information object from its name. The name can be either 2 or 3 letter ISO abbreviations for the country or the official name of the country in english.
Declaration
public Country GetFromIso(string isoCode)
Parameters
Type | Name | Description |
---|---|---|
string | isoCode | Name of the country: 2 and 3 letter ISO abbriviation for the name and name of the country according to ISO. e.g: "no" or "nor", "gb" or "gbr" |
Returns
Type | Description |
---|---|
Country | The Country information object, or null if not found |
GetFromPhoneNumber(string)
Get the Country information object from the country's phone prefix (e.g. "47" returns the CountryRow for Norway).
Declaration
public Country GetFromPhoneNumber(string strippedPhoneNumber)
Parameters
Type | Name | Description |
---|---|---|
string | strippedPhoneNumber |
Returns
Type | Description |
---|---|
Country | The Country information object |
GetFromPhonePrefix(string)
Get the Country information object from the country's phone prefix (e.g. "47" returns the CountryRow for Norway).
Declaration
public Country GetFromPhonePrefix(string phonePrefix)
Parameters
Type | Name | Description |
---|---|---|
string | phonePrefix | International dialing prefix: "+47" or "47" |
Returns
Type | Description |
---|---|
Country | The Country information object, or null if not found |
OnLoad()
Declaration
protected override void OnLoad()
Overrides
ParseMultiLanguageString(string)
Parse a multi-language string according to the default language of the current user's home country
Declaration
public string ParseMultiLanguageString(string multiLangString)
Parameters
Type | Name | Description |
---|---|---|
string | multiLangString | The multilanguage string to parse |
Returns
Type | Description |
---|---|
string | Parsed string; or original string if there is a problem |
Examples
String example from PrefDesc table: US:"Location and size";GE:"Position und Größe";NO:"Posisjon og størrelse"