Beispiel #1
0
        public static List <ModelCode> NadjiAtributeGID(long gid)
        {
            ModelResourcesDesc modResDes = new ModelResourcesDesc();
            List <ModelCode>   lista     = modResDes.GetAllPropertyIdsForEntityId(gid);

            return(lista);
        }
        public ResourceDescription GetAsResourceDescription(bool onlySettableAttributes)
        {
            ResourceDescription rd    = new ResourceDescription(globalId);
            List <ModelCode>    props = new List <ModelCode>();

            if (onlySettableAttributes == true)
            {
                props = resourcesDescs.GetAllSettablePropertyIdsForEntityId(globalId);
            }
            else
            {
                props = resourcesDescs.GetAllPropertyIdsForEntityId(globalId);
            }

            return(rd);
        }
Beispiel #3
0
        public static List <ModelCode> NadjiAtrIDs(long gid3)
        {
            ModelResourcesDesc modResDes = new ModelResourcesDesc();
            List <ModelCode>   lista     = modResDes.GetAllPropertyIdsForEntityId(gid3);
            List <ModelCode>   rez       = new List <ModelCode>();

            foreach (ModelCode mc in lista)
            {
                if (Property.GetPropertyType(mc) == PropertyType.Reference || Property.GetPropertyType(mc) == PropertyType.ReferenceVector)
                {
                    rez.Add(mc);
                }
            }

            return(rez);
        }
Beispiel #4
0
        public List <ResourceDescription> GetRelatedValues(long sourceGlobalId, Association association)
        {
            string message = "Getting related values method started.";

            Console.WriteLine(message);
            CommonTrace.WriteTrace(CommonTrace.TraceError, message);

            List <ResourceDescription> resultRds = new List <ResourceDescription>();


            int         numberOfResources = 5;
            List <long> ids = new List <long>();

            try
            {
                List <ModelCode> properties = new List <ModelCode>();

                //int iteratorId = GdaQueryProxy.GetRelatedValues(sourceGlobalId, properties, association);
                //int resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);

                int iteratorId    = NetworkModelGDAProxy.Instance.GetRelatedValues(sourceGlobalId, properties, association);
                int resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId);


                //import ids
                while (resourcesLeft > 0)
                {
                    //List<ResourceDescription> rds = GdaQueryProxy.IteratorNext(numberOfResources, iteratorId);
                    List <ResourceDescription> rds = NetworkModelGDAProxy.Instance.IteratorNext(numberOfResources, iteratorId);
                    foreach (var rd in rds)
                    {
                        ids.Add(rd.Id);
                    }

                    //resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);
                    resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId);
                }

                //find all properties for each id and call
                foreach (var id in ids)
                {
                    properties = modelResourcesDesc.GetAllPropertyIdsForEntityId(id);
                    //resultRds.Add(GdaQueryProxy.GetValues(id, properties));
                    resultRds.Add(NetworkModelGDAProxy.Instance.GetValues(id, properties));
                }

                //GdaQueryProxy.IteratorClose(iteratorId);
                NetworkModelGDAProxy.Instance.IteratorClose(iteratorId);
                //>>>>>>> Stashed changes

                //                if (properties.Count == 0)
                //                {
                //                    properties = modelResourcesDesc.GetAllPropertyIds(modelCode);
                //                }

                //                //iteratorId = GdaQueryProxy.GetExtentValues(modelCode, properties);
                //                //resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);

                //                iteratorId = NetworkModelGDAProxy.Instance.GetExtentValues(modelCode, properties);
                //                resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId);

                //                while (resourcesLeft > 0)
                //                {
                //                    //List<ResourceDescription> rds = GdaQueryProxy.IteratorNext(numberOfResources, iteratorId);
                //                    List<ResourceDescription> rds = NetworkModelGDAProxy.Instance.IteratorNext(numberOfResources, iteratorId);
                //                    retList.AddRange(rds);
                //                    //resourcesLeft = GdaQueryProxy.IteratorResourcesLeft(iteratorId);
                //                    resourcesLeft = NetworkModelGDAProxy.Instance.IteratorResourcesLeft(iteratorId);
                //                }

                //                //GdaQueryProxy.IteratorClose(iteratorId);
                //                NetworkModelGDAProxy.Instance.IteratorClose(iteratorId);

                //                message = "Getting extent values method successfully finished.";
                //                Console.WriteLine(message);
                //                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                //<<<<<<< Updated upstream

                //            }
                //            catch (Exception e)
                //            {
                //                message = string.Format("Getting extent values method failed for {0}.\n\t{1}", modelCode, e.Message);
                //                Console.WriteLine(message);
                //                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
                //            }
                //=======
            }
            catch (Exception e)
            {
                message = string.Format("Getting related values method  failed for sourceGlobalId = {0} and association (propertyId = {1}, type = {2}). Reason: {3}", sourceGlobalId, association.PropertyId, association.Type, e.Message);
                Console.WriteLine(message);
                CommonTrace.WriteTrace(CommonTrace.TraceError, message);
            }


            return(resultRds);
        }