Пример #1
0
        /// <summary>
        /// To import metadata from RTF file for all indicator classifications except source
        /// </summary>
        /// /// <param name="metadataInfo"></param>
        /// <param name="metaDataType"></param>
        /// <param name="elementNid"></param>
        public void ImportMetadataFromRTFFile(string metadataInfo, MetaDataType metadataType, int elementNId)
        {
            IndicatorClassificationBuilder ICBuilder = new IndicatorClassificationBuilder(this.DBConnection, this.DBQueries);

            try
            {
                ICBuilder.UpdateICInfo(elementNId, metadataInfo);
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }
        }
Пример #2
0
        /// <summary>
        /// To import metadata from RTF file for all indicator classifications except source
        /// </summary>
        /// /// <param name="metadataInfo"></param>
        /// <param name="metaDataType"></param>
        /// <param name="elementNid"></param>        
        public void ImportMetadataFromRTFFile(string metadataInfo, MetaDataType metadataType, int elementNId)
        {
            IndicatorClassificationBuilder ICBuilder = new IndicatorClassificationBuilder(this.DBConnection, this.DBQueries);

            try
            {
                ICBuilder.UpdateICInfo(elementNId, metadataInfo);
            }
            catch (Exception ex)
            {
                ExceptionFacade.ThrowException(ex);
            }
        }
Пример #3
0
        /// <summary>
        /// To Import metadata information
        /// </summary>
        /// <param name="dataPrefix"></param>
        /// <param name="sourceDBConnection"></param>
        /// <param name="sourceDBQueries"></param>
        /// <param name="selectedNIDs"></param>
        /// <param name="selectionCount"></param>
        /// <param name="metadataType"> </param>
        public void ImportICMetadata(string dataPrefix, DIConnection sourceDBConnection, DIQueries sourceDBQueries, string selectedNIDs, int selectionCount, MetaDataType metadataType, ICType classificationType)
        {
            string    MetadataInfo = string.Empty;
            DataTable TempDataTable;
            DataTable TempTargetIdTable = new DataTable();
            IndicatorClassificationBuilder ICBuilder;
            int TargetICNid = 0;

            int CurrentRecordIndex = 0;

            this.RaiseStartProcessEvent();

            try
            {
                ICBuilder = new IndicatorClassificationBuilder(this.DBConnection, this.DBQueries);

                if (selectionCount == -1)
                {
                    // -- GET ALL
                    TempDataTable = sourceDBConnection.ExecuteDataTable(sourceDBQueries.IndicatorClassification.GetIC(FilterFieldType.None, string.Empty, classificationType, FieldSelection.Heavy));
                }
                else
                {
                    // -- GET SELECTED
                    TempDataTable = sourceDBConnection.ExecuteDataTable(sourceDBQueries.IndicatorClassification.GetIC(FilterFieldType.NId, selectedNIDs, classificationType, FieldSelection.Heavy));
                }



                // -- Initialize Progress Bar
                this.RaiseBeforeProcessEvent(TempDataTable.Rows.Count);
                CurrentRecordIndex = 0;

                for (int Index = 0; Index <= TempDataTable.Rows.Count - 1; Index++)
                {
                    CurrentRecordIndex++;

                    if (!Information.IsDBNull(TempDataTable.Rows[Index][IndicatorClassifications.ICInfo]))
                    {
                        if (!(TempDataTable.Rows[Index][IndicatorClassifications.ICInfo].ToString().Length == 0))
                        {
                            //-- Retrieve Metadata Information
                            MetadataInfo = TempDataTable.Rows[Index][IndicatorClassifications.ICInfo].ToString();

                            // Get Target IC NID by Source IC GID
                            TargetICNid = ICBuilder.GetNidByGID(Convert.ToString(TempDataTable.Rows[Index][IndicatorClassifications.ICGId]), classificationType);

                            if (TargetICNid > 0)
                            {
                                //-- Update Metadata
                                ICBuilder.UpdateICInfo(TargetICNid, MetadataInfo);
                            }
                        }
                    }

                    // -- Increemnt the Progress Bar Value
                    this.RaiseProcessInfoEvent(CurrentRecordIndex);
                }

                // -- Dispose the Data Table object
                TempDataTable.Dispose();
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.ToString());
            }
        }
Пример #4
0
        /// <summary>
        /// To Import metadata information 
        /// </summary>
        /// <param name="dataPrefix"></param>
        /// <param name="sourceDBConnection"></param>
        /// <param name="sourceDBQueries"></param>
        /// <param name="selectedNIDs"></param>
        /// <param name="selectionCount"></param>
        /// <param name="metadataType"> </param>
        public void ImportICMetadata(string dataPrefix, DIConnection sourceDBConnection, DIQueries sourceDBQueries, string selectedNIDs, int selectionCount, MetaDataType metadataType, ICType classificationType)
        {
            string MetadataInfo = string.Empty;
            DataTable TempDataTable;
            DataTable TempTargetIdTable = new DataTable();
            IndicatorClassificationBuilder ICBuilder;
            int TargetICNid = 0;

            int CurrentRecordIndex = 0;
            this.RaiseStartProcessEvent();

            try
            {
                ICBuilder = new IndicatorClassificationBuilder(this.DBConnection, this.DBQueries);

                if (selectionCount == -1)
                {
                    // -- GET ALL
                    TempDataTable = sourceDBConnection.ExecuteDataTable(sourceDBQueries.IndicatorClassification.GetIC(FilterFieldType.None, string.Empty, classificationType, FieldSelection.Heavy));
                }
                else
                {
                    // -- GET SELECTED
                    TempDataTable = sourceDBConnection.ExecuteDataTable(sourceDBQueries.IndicatorClassification.GetIC(FilterFieldType.NId, selectedNIDs, classificationType, FieldSelection.Heavy));
                }

                // -- Initialize Progress Bar
                this.RaiseBeforeProcessEvent(TempDataTable.Rows.Count);
                CurrentRecordIndex = 0;

                for (int Index = 0; Index <= TempDataTable.Rows.Count - 1; Index++)
                {
                    CurrentRecordIndex++;

                    if (!Information.IsDBNull(TempDataTable.Rows[Index][IndicatorClassifications.ICInfo]))
                    {
                        if (!(TempDataTable.Rows[Index][IndicatorClassifications.ICInfo].ToString().Length == 0))
                        {

                            //-- Retrieve Metadata Information
                            MetadataInfo = TempDataTable.Rows[Index][IndicatorClassifications.ICInfo].ToString();

                            // Get Target IC NID by Source IC GID
                            TargetICNid = ICBuilder.GetNidByGID(Convert.ToString(TempDataTable.Rows[Index][IndicatorClassifications.ICGId]), classificationType);

                            if (TargetICNid > 0)
                            {
                                //-- Update Metadata
                                ICBuilder.UpdateICInfo(TargetICNid, MetadataInfo);
                            }
                        }
                    }

                    // -- Increemnt the Progress Bar Value
                    this.RaiseProcessInfoEvent(CurrentRecordIndex);
                }

                // -- Dispose the Data Table object
                TempDataTable.Dispose();
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.ToString());
            }
        }