Added serializability to Geography, methods to Automation/GetGeographyData
This commit is contained in:
@@ -30,24 +30,24 @@ namespace Activizr.Basic.Types
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The database node id.
|
||||
/// The database id of this geography.
|
||||
/// </summary>
|
||||
public readonly int GeographyId;
|
||||
public int GeographyId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The database node id of the parent node.
|
||||
/// The database id of the parent geography, for linking in a tree structure.
|
||||
/// </summary>
|
||||
public readonly int ParentGeographyId;
|
||||
public int ParentGeographyId { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The friendly name of the node (city, county, region, etc).
|
||||
/// </summary>
|
||||
public readonly string Name;
|
||||
public string Name { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The generation of this node. Used in tree-style listings.
|
||||
/// </summary>
|
||||
public readonly int Generation;
|
||||
public int Generation { get; protected set; }
|
||||
|
||||
#region IHasIdentity Members
|
||||
|
||||
|
||||
@@ -35,4 +35,15 @@ public class GetGeographyData : System.Web.Services.WebService {
|
||||
return PostalCodes.ForCountry(countryCode);
|
||||
}
|
||||
|
||||
public Geographies GetGeographiesFromRoot (int rootId)
|
||||
{
|
||||
return Geography.FromIdentity(rootId).GetTree();
|
||||
}
|
||||
|
||||
public Geographies GetGeographiesForCountry (string countryCode)
|
||||
{
|
||||
Country country = Country.FromCode(countryCode);
|
||||
return GetGeographiesFromRoot(country.GeographyId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user