public BasicUptakeGeography(BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
Beispiel #2
0
        public UptakeGeography[] GetUptakeGeographies (bool others)
        {
            BasicUptakeGeography[] basics = SwarmDb.GetDatabaseForReading().GetOrganizationUptakeGeographies(Identity, others);
            List<UptakeGeography> retVal = new List<UptakeGeography>();
            foreach (BasicUptakeGeography b in basics)
            {
                try
                {
                    UptakeGeography ug = UptakeGeography.FromBasic(b);
                    if (ug.Organization != null && ug.Geography != null && ug.Organization.ParentIdentity != -1)
                        retVal.Add(UptakeGeography.FromBasic(b));
                }
                catch
                {
                    //catch bad references
                }
            }

            if (others)
            {
                Dictionary<int, BasicOrganization> allOrgs = OrganizationCache.GetOrganizationHashtable(Organization.RootIdentity);
                foreach (BasicOrganization bo in allOrgs.Values)
                {
                    if (bo.Identity > 0)
                    {
                        BasicUptakeGeography myAnchor = new BasicUptakeGeography(bo.Identity, bo.AnchorGeographyId);
                        retVal.Add(UptakeGeography.FromBasic(myAnchor));
                    }
                }
            }
            else
            {
                BasicUptakeGeography myAnchor = new BasicUptakeGeography(Identity, AnchorGeographyId);
                if (retVal.Find(delegate(UptakeGeography ug) { return ug.GeoId == AnchorGeographyId; }) == null)
                    retVal.Add(UptakeGeography.FromBasic(myAnchor));
            }

            return retVal.ToArray();
        }
Beispiel #3
0
 public static UptakeGeography FromBasic (BasicUptakeGeography basic)
 {
     return new UptakeGeography(basic);
 }
 public BasicUptakeGeography (BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
Beispiel #5
0
        } // disallow public direct construction

        private UptakeGeography (BasicUptakeGeography basic)
            : base(basic)
        {
        }