Beispiel #1
0
        /// <summary>
        /// Merges import entities.
        /// </summary>
        /// <param name="parameters">File import parameters.</param>
        protected virtual void MergeImportEntities(ImportParameters parameters)
        {
            var keyColumns = GetKeyColumns(parameters).ToList();

            if (keyColumns.Any())
            {
                parameters.Entities = GetMergedImportEntities(parameters.Entities, keyColumns);
                var mergedRowsCount = (uint)(parameters.TotalRowsCount - parameters.Entities.Count);
                if (mergedRowsCount > 0)
                {
                    parameters.NotImportedRowsCount += mergedRowsCount;
                    var eventArgs = new InfoMessageEventArgs {
                        Message = GetMergedImportEntitiesInfoMessage(mergedRowsCount)
                    };
                    OnImportEntitiesMerge(eventArgs);
                }
            }
        }
Beispiel #2
0
        private void MergeImportEntities(ImportParameters parameters)
        {
            var keyColumns = GetKeyColumns(parameters).ToList();

            if (keyColumns.Any())
            {
                parameters.Entities = GetMergedImportEntities(parameters.Entities, keyColumns);
                var mergedRowsCount = (uint)(parameters.TotalRowsCount - parameters.Entities.Count);
                if (mergedRowsCount > 0)
                {
                    parameters.NotImportedRowsCount += mergedRowsCount;
                    var eventArgs = new InfoMessageEventArgs {
                        Message = GetMergedImportEntitiesInfoMessage(mergedRowsCount)
                    };
                    ImportLogger.HandleInfoMessage(this, eventArgs);
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Send message after merge entities
 /// </summary>
 /// <param name="eventArgs"></param>
 protected void OnImportEntitiesMerge(InfoMessageEventArgs eventArgs)
 {
     ImportEntitiesMerge?.Invoke(this, eventArgs);
 }