Exemplo n.º 1
0
        private void FinishedImporting(object sender, RunWorkerCompletedEventArgs e)
        {
            _Stopwatch.Stop();
            if (0 == CountSelected)
            {
                return;
            }
            _FinishedImporting.Clear();
            CumulativeCountError     += CountError;
            CumulativeCountProcessed += CountProcessed;
            string msg = string.Format("EBS Bulk Import completed importing {0} records from {1} in {2:0.00} minutes. {3} errors",
                                       CountProcessed, Title, (double)_Stopwatch.ElapsedMilliseconds / 60000d, CountError);

            if (RepairOrders.Count == CumulativeCountProcessed)
            {
                msg = string.Format("EBS Bulk Import finished importing {0} records from {1} in {2:0.00} minutes. {3} errors. Nothing left to import.",
                                    CountProcessed, Title, (double)_Stopwatch.ElapsedMilliseconds / 60000d, CountError);
                _JobStatus = 0 == CumulativeCountError ? JobStatus.AllDone : JobStatus.AllDoneError;
                _Model._Proxy.MarkFileImported(this);
            }
            _Model.ShowNotificationWindow(msg);
            RefreshStatus();
            CountSelected = 0;
            if (0 == CountError)
            {
                _Proxy.DebugLog(msg, null);
            }
            else
            {
                _Proxy.NoticeLog(msg, null);
            }
        }