Пример #1
0
        private void AddColumnsIntoIndicatorClassificationsTable(bool forOnlineDB, DITables tablesName, DIServerType serverType)
        {
            try
            {
                // Add IC_short_name Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.ICShortName, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertICShortNameColumn(tablesName, forOnlineDB, serverType));
                }

                // Add publisher Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.Publisher, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertPublisherColumn(tablesName, forOnlineDB, serverType));
                }

                // Add title Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.Title, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertTitleColumn(tablesName, forOnlineDB, serverType));
                }

                // Add DIYear Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.DIYear, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertDIYearColumn(tablesName, forOnlineDB, serverType));
                }

                // Add SourceLink1 Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.SourceLink1, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertSourceLink1Column(tablesName, forOnlineDB, serverType));
                }

                // Add SourceLink2 Column
                if (!DICommon.ISColumnExistInTable(this._DBConnection, IndicatorClassifications.SourceLink2, tablesName.IndicatorClassifications))
                {
                    this.DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.InsertSourceLink2Column(tablesName, forOnlineDB, serverType));
                }
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }
        }
Пример #2
0
        private void RenameIndicatorClassificationIUSTable(bool forOnlineDB, DITables tablesName, DIServerType serverType)
        {
            try
            {
                if (DICommon.ISColumnExistInTable(this.DBConnection, " top 1 * ", this._DBQueries.DataPrefix + "ic_ius"))
                {
                    //-- Carate New IC_IUS table from existing table
                    this._DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Insert.CreateOldICIUSTableFromExisting(this._DBQueries.DataPrefix));

                    //-- Delete new table
                    this._DBConnection.ExecuteNonQuery(DevInfo.Lib.DI_LibDAL.Queries.IndicatorClassification.Delete.DeleteNewICIUSTable(this._DBQueries.DataPrefix));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }