Files
using.cash/Basic/Types/BasicCountry.cs
T

69 lines
2.1 KiB
C#

using System;
using Swarmops.Basic.Interfaces;
namespace Swarmops.Basic.Types
{
[Serializable]
public class BasicCountry : IHasIdentity
{
public BasicCountry(int countryId, string name, string code)
{
CountryId = countryId;
Name = name;
Code = code;
}
public BasicCountry(int countryId, string name, string code, string defaultCulture, string currencyCode,
int geographyId, int postalCodeLength)
: this(countryId, name, code)
{
Culture = defaultCulture;
CurrencyCode = currencyCode;
GeographyId = geographyId;
PostalCodeLength = postalCodeLength;
}
public BasicCountry(BasicCountry original)
: this(
original.CountryId, original.Name, original.Code, original.Culture, original.CurrencyCode,
original.GeographyId, original.PostalCodeLength)
{
}
[Obsolete("Do not call this function directly. It exists to enable serialization.", true)]
public BasicCountry()
{
// this does not initialize the Basic Country, but exists to enable serialization.
}
public int CountryId { get; private set; }
public string Name { get; protected set; }
public string Code { get; protected set; }
public string Culture { get; protected set; }
public string CurrencyCode { get; protected set; }
public int GeographyId { get; protected set; }
public int PostalCodeLength { get; protected set; }
public int CurrencyId
{
get
{
if (Code == "SE")
{
return 1;
}
throw new NotImplementedException("BasicCountry.CurrencyId");
}
}
#region IHasIdentity Members
public int Identity
{
get { return CountryId; }
}
#endregion
}
}