static public BasicGeography[] GetGeographyLine (int leafGeographyId) { List<BasicGeography> result = new List<BasicGeography>(); BasicGeography currentNode = GeographyCache.GetGeography(leafGeographyId); // This iterates until the zero-parentid root node is found while (currentNode.GeographyId != 0) { result.Add(currentNode); if (currentNode.ParentGeographyId != 0) { currentNode = GeographyCache.GetGeography(currentNode.ParentGeographyId); } else { currentNode = new BasicGeography(0, 0, string.Empty); } } result.Reverse(); return result.ToArray(); }
public BasicGeography[] GetGeographyLine (int leafGeographyId) { List<BasicGeography> result = new List<BasicGeography>(); Dictionary<int, List<BasicGeography>> nodes = GetHashedGeographies(); BasicGeography currentNode = nodes[leafGeographyId][0]; // This iterates until the zero-parentid root node is found while (currentNode.GeographyId != 0) { result.Add(currentNode); if (currentNode.ParentGeographyId != 0) { currentNode = nodes[currentNode.ParentGeographyId][0]; } else { currentNode = new BasicGeography(0, 0, string.Empty); } } result.Reverse(); return result.ToArray(); }
public int[] GetOrganizationsIdsInGeographies (BasicGeography[] nodes) { if (nodes == null || nodes.Length == 0) { return new int[0]; } List<int> nodeIdList = new List<int>(); foreach (BasicGeography node in nodes) { nodeIdList.Add(node.GeographyId); } return GetOrganizationIdsInGeographies(nodeIdList.ToArray()); }
public static Geography FromBasic (BasicGeography basic) { return new Geography(basic); }
private Geography (BasicGeography basic) : base(basic) { // construction from basic }
public BasicGeography (BasicGeography original) : this(original.GeographyId, original.ParentGeographyId, original.Name, original.Generation) { }
public BasicGeography(BasicGeography original) : this(original.GeographyId, original.ParentGeographyId, original.Name, original.Generation) { }