コード例 #1
0
 public BasicUptakeGeography(BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
コード例 #2
0
ファイル: Organization.cs プロジェクト: SwarmCorp/Swarmops
        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();
        }
コード例 #3
0
ファイル: UptakeGeography.cs プロジェクト: SwarmCorp/Swarmops
 public static UptakeGeography FromBasic (BasicUptakeGeography basic)
 {
     return new UptakeGeography(basic);
 }
コード例 #4
0
 public BasicUptakeGeography (BasicUptakeGeography other)
 {
     this.orgId = other.orgId;
     this.geoId = other.geoId;
 }
コード例 #5
0
ファイル: UptakeGeography.cs プロジェクト: SwarmCorp/Swarmops
        } // disallow public direct construction

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