Ejemplo n.º 1
0
        /// <summary>
        /// Update auto calculated columns ( IC table - Publisher, Year & title ,Indicator table- Data_Exists, area table - data_exist, IUS table - subgroup_nids & data_exist) into the database/template
        /// </summary>
        /// <returns></returns>
        public bool UpdateAutoCalculatedFieldsInTables()
        {
            bool RetVal = false;
            IndicatorClassificationBuilder ICBuilder;
            IndicatorBuilder IndBuilder;
            IUSBuilder IUSBuilderObj;
            AreaBuilder AreaBuilderObj;
            try
            {
                // 1. Indicator classification table - Publisher, year & title columns
                ICBuilder = new IndicatorClassificationBuilder(this.DBConnection, this.DBQueries);
                ICBuilder.UpdatePublisherTitleYear();

                // 2. Indicator table - Data_exist column
                IndBuilder = new IndicatorBuilder(this.DBConnection, this.DBQueries);
                IndBuilder.UpdateDataExistValues();

                // 3. IUS table- Subgroup_Nids & Data_Exist columns
                IUSBuilderObj = new IUSBuilder(this.DBConnection, this.DBQueries);
                IUSBuilderObj.UpdateSubgroupNids();
                IUSBuilderObj.UpdateDataExistValues();

                // 4. Area table- Data_Exist column
                AreaBuilderObj = new AreaBuilder(this.DBConnection, this.DBQueries);
                AreaBuilderObj.UpdateDataExistValues();

                RetVal = true;
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }

            return RetVal;
        }