<%@ Page Language="C#" %> <%@ Import Namespace="Activizr.Logic.Structure" %> <%@ Import Namespace="Activizr.Logic.Pirates" %> <%@ Import Namespace="Activizr.Basic.Enums" %> <%@ Import Namespace="System.Collections.Generic" %> <% string geoString = Request.QueryString["GeographyId"]; int geoRootId = 30; if (geoString != null && geoString.Length > 0) { geoRootId = Int32.Parse(geoString.Trim()); } Geography geoRoot = Geography.FromIdentity(geoRootId); Geographies geographies = geoRoot.GetTree(); Geographies upwardsList = new Geographies(); while (geoRoot.GeographyId != 30) { upwardsList.Insert(0, geoRoot); geoRoot = geoRoot.Parent; } %>
<% foreach (Geography geo in upwardsList) { Response.Write(PrintGeography(geo)); } for (int geoIndex = 1; geoIndex < geographies.Count; geoIndex++) { Response.Write(PrintGeography(geographies[geoIndex])); } %>