Exemple #1
0
        public StructuredDataStructure GetDataStructureByID(long ID)
        {
            DataStructureManager    dsm = new DataStructureManager();
            StructuredDataStructure structuredDataStructure = dsm.StructuredDataStructureRepo.Get(ID);

            this.dataStructure = structuredDataStructure;

            if (this.dataStructure != null)
            {
                this.variables = getOrderedVariables(structuredDataStructure);

                if (this.dataStructure.Datasets == null)
                {
                    inUse = false;
                }
                else
                {
                    if (this.dataStructure.Datasets.Count > 0)
                    {
                        inUse = true;
                        DatasetListElement datasetListElement = new DatasetListElement();
                        DatasetManager     dm = new DatasetManager();
                        foreach (Dataset d in structuredDataStructure.Datasets)
                        {
                            if (dm.GetDatasetLatestMetadataVersion(d.Id) != null)
                            {
                                datasetListElement = new DatasetListElement(d.Id, XmlDatasetHelper.GetInformation(d, AttributeNames.title));
                            }
                            else
                            {
                                datasetListElement = new DatasetListElement(0, "");
                            }
                            datasets.Add(datasetListElement);
                        }
                    }
                    else
                    {
                        inUse = false;
                    }
                }
                this.BuildDataTable();
                return(structuredDataStructure);
            }
            else
            {
                this.dataStructure = new StructuredDataStructure();
                return(structuredDataStructure);
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param name="ID"></param>
        /// <param name="structured"></param>
        /// <returns></returns>
        public DataStructure GetDataStructureByID(long ID, bool structured)
        {
            this.structured = structured;
            if (structured)
            {
                return(this.GetDataStructureByID(ID));
            }
            else
            {
                DataStructureManager      dsm = new DataStructureManager();
                UnStructuredDataStructure unStructuredDataStructure = dsm.UnStructuredDataStructureRepo.Get(ID);
                this.dataStructure = unStructuredDataStructure;

                if (this.dataStructure != null)
                {
                    this.variables = null;
                    if (this.dataStructure.Datasets == null)
                    {
                        inUse = false;
                    }
                    else
                    {
                        if (this.dataStructure.Datasets.Count > 0)
                        {
                            inUse = true;
                            DatasetListElement datasetListElement = new DatasetListElement();
                            DatasetManager     dm = new DatasetManager();
                            foreach (Dataset d in unStructuredDataStructure.Datasets)
                            {
                                datasetListElement = new DatasetListElement(d.Id, XmlDatasetHelper.GetInformation(d, AttributeNames.title));
                                datasets.Add(datasetListElement);
                            }
                        }
                        else
                        {
                            inUse = false;
                        }
                    }
                    return(unStructuredDataStructure);
                }
                else
                {
                    this.dataStructure = new StructuredDataStructure();
                    return(unStructuredDataStructure);
                }
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <remarks></remarks>
        /// <seealso cref=""/>
        /// <param name="ID"></param>
        /// <param name="structured"></param>
        /// <returns></returns>
        public DataStructure GetDataStructureByID(long ID, bool structured)
        {
            this.structured = structured;
            if (structured)
            {
                return this.GetDataStructureByID(ID);
            }
            else
            {
                DataStructureManager dsm = new DataStructureManager();
                UnStructuredDataStructure unStructuredDataStructure = dsm.UnStructuredDataStructureRepo.Get(ID);
                this.dataStructure = unStructuredDataStructure;

                if (this.dataStructure != null)
                {
                    this.variables = null;
                    if (this.dataStructure.Datasets == null)
                    {
                        inUse = false;
                    }
                    else
                    {
                        if (this.dataStructure.Datasets.Count > 0)
                        {
                            inUse = true;
                            DatasetListElement datasetListElement = new DatasetListElement();
                            DatasetManager dm = new DatasetManager();
                            foreach (Dataset d in unStructuredDataStructure.Datasets)
                            {
                                datasetListElement = new DatasetListElement(d.Id, XmlDatasetHelper.GetInformation(d,AttributeNames.title));
                                datasets.Add(datasetListElement);
                            }
                        }
                        else
                        {
                            inUse = false;
                        }
                    }
                    return (unStructuredDataStructure);
                }
                else
                {
                    this.dataStructure = new StructuredDataStructure();
                    return (unStructuredDataStructure);
                }
            }
        }
        public StructuredDataStructure GetDataStructureByID(long ID)
        {
            DataStructureManager dsm = new DataStructureManager();
            StructuredDataStructure structuredDataStructure = dsm.StructuredDataStructureRepo.Get(ID);
            this.dataStructure = structuredDataStructure;

            if (this.dataStructure != null)
            {
                this.variables = getOrderedVariables(structuredDataStructure);

                if (this.dataStructure.Datasets == null)
                {
                    inUse = false;
                }
                else
                {
                    if (this.dataStructure.Datasets.Count > 0)
                    {
                        inUse = true;
                        DatasetListElement datasetListElement = new DatasetListElement();
                        DatasetManager dm = new DatasetManager();
                        foreach (Dataset d in structuredDataStructure.Datasets)
                        {
                            if (dm.GetDatasetLatestMetadataVersion(d.Id) != null)
                                datasetListElement = new DatasetListElement(d.Id, XmlDatasetHelper.GetInformation(d, AttributeNames.title));
                            else
                                datasetListElement = new DatasetListElement(0, "");
                            datasets.Add(datasetListElement);
                        }
                    }
                    else
                    {
                        inUse = false;
                    }
                }
                this.BuildDataTable();
                return (structuredDataStructure);
            }
            else
            {
                this.dataStructure = new StructuredDataStructure();
                return (structuredDataStructure);
            }
        }