예제 #1
0
        ///############################################################
        /// <summary>
        /// Populates the global variables holding the <c>Cn.Web</c> settings.
        /// </summary>
        /// <remarks>
        /// NOTE: This function relies on the default table names for the system settings ("cnInternationalization", "cnRendererConfiguration", "cnHolidayCalculations", and "cnPicklists"). If you have chosen to rename your system configuration tables, you will need to utilize this function's sibling implementation.
        /// <para/>NOTE: This function assumes that the Default Internationalization table name is "cnInternationalization".
        /// </remarks>
        /// <param name="oDBMS"><c>DBMS</c> instance representing an active connection to the related data source.</param>
        /// <param name="bInternationalizationDefaultData">Boolean value representing if the Default Internationalization global variable is to be updated.</param>
        /// <param name="bInternationalization">Boolean value representing if the <paramref>sSystemName</paramref>'s Internationalization global variable is to be updated.</param>
        /// <param name="bPicklists">Boolean value representing if the persistent Picklists's (named after the <paramref>sSystemName</paramref>) global variable is to be updated.</param>
        /// <param name="bMetaData">Boolean value representing if the <paramref>sSystemName</paramref>'s DataSource MetaData global variable is to be updated.</param>
        /// <param name="eDataSource">Enumeration representing the source the <paramref>oDataSourceMetaData</paramref> was generated from.</param>
        /// <param name="sDataSourceContainerName">String representing the name of the data source's container.</param>
        /// <exception cref="Cn.CnException">Thrown when the passed <paramref>eDataSource</paramref> is unsupported or unreconized.</exception>
        ///############################################################
        /// <LastUpdated>May 28, 2007</LastUpdated>
        public static void GetData(DBMS oDBMS, bool bInternationalizationDefaultData, bool bInternationalization, bool bPicklists, bool bMetaData, enumDataSource eDataSource, string sDataSourceContainerName)
        {
            string sInternationalizationDefaultDataTableName = "";
            string sInternationalizationTableName            = "";
            string sMetaDataTableName  = "";
            string sPicklistsTableName = "";

            //#### Setup the local s*TableName variables to the default names based on the passed information (skipping any set to false)
            if (bInternationalizationDefaultData)
            {
                sInternationalizationDefaultDataTableName = "cnInternationalization";
            }
            if (bInternationalization)
            {
                sInternationalizationTableName = "cnInternationalization";
            }
            if (bPicklists)
            {
                sPicklistsTableName = "cnPicklists";
            }
            if (bMetaData)
            {
                //#### Determine the eDataSource, setting sMetaDataTableName accordingly
                switch (eDataSource)
                {
                case enumDataSource.cnSQLServer: {
                    sMetaDataTableName = sDataSourceContainerName + ".INFORMATION_SCHEMA.COLUMNS";
                    break;
                }

                case enumDataSource.cnOracle: {
                    sMetaDataTableName = "all_tab_columns";
                    break;
                }

                //#### Else the passed eDataSource is unsupported or unreconized, so raise the error (based on the passed sSystemName)
                default: {
                    Internationalization.RaiseDefaultError(g_cClassName + "", Internationalization.enumInternationalizationValues.cnDeveloperMessages_General_UnknownValue, "eDataSource", Data.Tools.MakeString(eDataSource, ""));
                    break;
                }
                }
            }

            //#### Pass the call off to our sibling implementation to do the actual work
            GetData(oDBMS,
                    sInternationalizationDefaultDataTableName,
                    sInternationalizationTableName,
                    sPicklistsTableName,
                    sMetaDataTableName,
                    eDataSource
                    );
        }
예제 #2
0
        ///############################################################
        /// <summary>
        /// Populates the global variables holding the <c>Cn.Web</c> settings.
        /// </summary>
        /// <param name="oDBMS"><c>DBMS</c> instance representing an active connection to the related data source.</param>
        /// <param name="sInternationalizationDefaultDataTableName">String representing the name of the Default Internationalization table.</param>
        /// <param name="sInternationalizationTableName">String representing the name of the <paramref>sSystemName</paramref>'s Internationalization table.</param>
        /// <param name="sPicklistsTableName">String representing the name of the Picklists table.</param>
        /// <param name="sMetaDataTableName">String representing the name of the <paramref>sSystemName</paramref>'s DataSource MetaData view/table.</param>
        /// <param name="eDataSource">Enumeration representing the source the <paramref>oDataSourceMetaData</paramref> was generated from.</param>
        ///############################################################
        /// <LastUpdated>May 29, 2007</LastUpdated>
        public static void GetData(DBMS oDBMS, string sInternationalizationDefaultDataTableName, string sInternationalizationTableName, string sPicklistsTableName, string sMetaDataTableName, enumDataSource eDataSource)
        {
            MultiArray[] a_oResults;
            string       sSQL = "";
            int          iDefaultInternationalization = -1;
            int          iInternationalization        = -1;
            int          iMetaData  = -1;
            int          iPicklists = -1;
            int          i          = 0;

            //#### Create the required sSQL statement bassed on the passed information (skipping any with blank table names)
            if (!string.IsNullOrEmpty(sInternationalizationDefaultDataTableName))
            {
                sSQL += Internationalization.GetData.SQLStatement(sInternationalizationDefaultDataTableName) + "; ";
                iDefaultInternationalization = i;
                i++;
            }
            if (!string.IsNullOrEmpty(sInternationalizationTableName))
            {
                sSQL += Internationalization.GetData.SQLStatement(sInternationalizationTableName) + "; ";
                iInternationalization = i;
                i++;
            }
            if (!string.IsNullOrEmpty(sPicklistsTableName))
            {
                sSQL      += Picklists.GetData.SQLStatement(sPicklistsTableName) + "; ";
                iPicklists = i;
                i++;
            }
            if (!string.IsNullOrEmpty(sMetaDataTableName))
            {
                sSQL     += MetaData.GetData.SQLStatement(sMetaDataTableName, eDataSource) + "; ";
                iMetaData = i;
                //i++;
            }

            //#### Collect the a_oResults based on the above created sSQL statement
            a_oResults = oDBMS.GetMultiArrays(sSQL);

            //#### GetData the various configuration structures with the data within the a_oResults (skipping any with blank table names)
            if (iDefaultInternationalization != -1)
            {
                Internationalization.DefaultData = a_oResults[iDefaultInternationalization];
            }
            if (iInternationalization != -1)
            {
                Internationalization = new Internationalization(a_oResults[iInternationalization]);
            }
            if (iPicklists != -1)
            {
                Picklists = new Picklists(a_oResults[iPicklists]);
            }
            if (iMetaData != -1)
            {
                MetaData = new MetaData(a_oResults[iMetaData], eDataSource);

                //#### If Web.Settings.Picklists was also set above, .Set(the)RelatedPicklists now
                if (iPicklists != -1)
                {
                    MetaData.SetRelatedPicklists(Picklists);
                }
            }
        }
예제 #3
0
 /// <summary>
 /// Public constructor
 /// </summary>
 /// <param name="DataSource">Data source</param>
 /// <param name="GapFillSource">Gap fill source</param>
 /// <param name="FeatureRequest">FeatureRequest</param>
 /// <param name="StartDate">Start date</param>
 /// <param name="EndDate">End date</param>
 /// <param name="temporalAggregation">Temporal Aggregation</param>
 /// <param name="Series">Series</param>
 public WeatherDataRequest(enumDataSource dataSource, bool gapFillSource, FeatureRequest featureRequest,
     DateTime startDate, DateTime endDate, enumTemporalAggregation temporalAggregation, List<Serie> series)
 {
     this.DataSource = dataSource;
     this.GapFillSource = gapFillSource;
     this.FeatureRequest = featureRequest;
     this.StartDate = startDate;
     this.EndDate = endDate;
     this.Series = series;
     this.temporalAggregation = temporalAggregation;
 }