public BasicUptakeGeography(BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
Exemple #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();
        }
 public static UptakeGeography FromBasic (BasicUptakeGeography basic)
 {
     return new UptakeGeography(basic);
 }
 public BasicUptakeGeography (BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
        } // disallow public direct construction

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