예제 #1
0
        public static bool Generate_Data(SDMXSchemaType schemaType, XmlDocument query, DataFormats format, DIConnection DIConnection, DIQueries DIQueries, string outputFolder)
        {
            bool RetVal;
            BaseDataUtility BaseDataUtility;

            RetVal = false;
            BaseDataUtility = null;

            try
            {
                switch (format)
                {
                    case DataFormats.Generic:
                        BaseDataUtility = new GenericDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.GenericTS:
                        BaseDataUtility = new GenericTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecific:
                        BaseDataUtility = new StructureSpecificDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecificTS:
                        BaseDataUtility = new StructureSpecificTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    default:
                        break;
                }

                RetVal = BaseDataUtility.Generate_Data(query, outputFolder);
            }
            catch (Exception ex)
            {
                RetVal = false;
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }
예제 #2
0
        public static XmlDocument Get_Data(SDMXSchemaType schemaType, XmlDocument query, DataFormats format, DIConnection DIConnection, DIQueries DIQueries)
        {
            XmlDocument RetVal;
            BaseDataUtility BaseDataUtility;

            RetVal = null;
            BaseDataUtility = null;

            try
            {
                switch (format)
                {
                    case DataFormats.Generic:
                        BaseDataUtility = new GenericDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.GenericTS:
                        BaseDataUtility = new GenericTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecific:
                        BaseDataUtility = new StructureSpecificDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecificTS:
                        BaseDataUtility = new StructureSpecificTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    default:
                        break;
                }

                RetVal = BaseDataUtility.Get_Data(query);
            }
            catch (Exception ex)
            {
                if (!ex.Message.Contains(Constants.SDMXWebServices.Exceptions.InvalidSyntax.Message) &&
                    !ex.Message.Contains(Constants.SDMXWebServices.Exceptions.NoResults.Message) &&
                    !ex.Message.Contains(Constants.SDMXWebServices.Exceptions.NotImplemented.Message))
                {
                    throw new Exception(Constants.SDMXWebServices.Exceptions.ServerError.Message);
                }
                else
                {
                    throw ex;
                }
            }
            finally
            {
            }

            return RetVal;
        }
예제 #3
0
        public static bool Generate_Data(SDMXSchemaType schemaType, XmlDocument query, DataFormats format, DIConnection DIConnection, DIQueries DIQueries, string outputFolder, out int fileCount,out List<string> GeneratedFiles,SDMXObjectModel.Message.StructureHeaderType Header)
        {
            bool RetVal;
            BaseDataUtility BaseDataUtility;

            RetVal = false;
            BaseDataUtility = null;
            fileCount = 0;
            GeneratedFiles = new List<string>();
            try
            {
                switch (format)
                {
                    case DataFormats.Generic:
                        BaseDataUtility = new GenericDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.GenericTS:
                        BaseDataUtility = new GenericTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecific:
                        BaseDataUtility = new StructureSpecificDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    case DataFormats.StructureSpecificTS:
                        BaseDataUtility = new StructureSpecificTimeSeriesDataUtility(DIConnection, DIQueries, string.Empty);
                        break;
                    default:
                        break;
                }

                RetVal = BaseDataUtility.Generate_Data(query, outputFolder,out fileCount,out GeneratedFiles,Header);
            }
            catch (Exception ex)
            {
                RetVal = false;
                throw ex;
            }
            finally
            {
            }

            return RetVal;
        }