diff --git a/Logic/Structure/Geography.cs b/Logic/Structure/Geography.cs index 17109730..25040fd8 100644 --- a/Logic/Structure/Geography.cs +++ b/Logic/Structure/Geography.cs @@ -1,4 +1,5 @@ using System; +using System.Xml.Serialization; using Activizr.Logic.Cache; using Activizr.Logic.Interfaces; using Activizr.Basic.Enums; @@ -113,11 +114,15 @@ namespace Activizr.Logic.Structure get { return Children.Identities; } } + [XmlIgnore] // interface cannot be serialized + [SoapIgnore] public ITreeNodeObject ParentObject { get { return this.Parent; } } + [XmlIgnore] // interface cannot be serialized + [SoapIgnore] public List ChildObjects { get diff --git a/Site5/Automation/GetGeographyData.asmx b/Site5/Automation/GetGeographyData.asmx index c8f2bb2d..362646aa 100644 --- a/Site5/Automation/GetGeographyData.asmx +++ b/Site5/Automation/GetGeographyData.asmx @@ -4,8 +4,6 @@ using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; -using Activizr.Basic.Types; -using Activizr.Database; using Activizr.Logic.Structure; [WebService(Namespace = "http://activizr.com/")] @@ -38,6 +36,21 @@ public class GetGeographyData : System.Web.Services.WebService { } [WebMethod] + public Geographies GetGeographiesFromRoot (int rootId) + { + return Geography.FromIdentity(rootId).GetTree(); + } + + [WebMethod] + public Geographies GetGeographiesForCountry (string countryCode) + { + Country country = Country.FromCode(countryCode); + return GetGeographiesFromRoot(country.GeographyId); + } + + /* + + [WebMethod] public BasicGeography[] GetGeographiesFromRoot (int rootId) { return PirateDb.GetDatabase().GetGeographyTree(rootId); @@ -49,5 +62,6 @@ public class GetGeographyData : System.Web.Services.WebService { Country country = Country.FromCode(countryCode); return PirateDb.GetDatabase().GetGeographyTree(country.GeographyId); } - + + */ } \ No newline at end of file