예제 #1
0
        private void Next()
        {
            if (_valuePane.CurrentFailure == null)
            {
                return;
            }

            int skipped = 0;
            int updated = 0;

            try
            {
                while (CurrentReport.Next())
                {
                    var next = CurrentReport.Current;

                    //prefer rules that say we should update the database with redacted over rules that say we should ignore the problem
                    if (!Updater.OnLoad(null, next, out _))
                    {
                        updated++;
                    }
                    else if (!Ignorer.OnLoad(next, out _))
                    {
                        skipped++;
                    }
                    else
                    {
                        SetupToShow(next);

                        break;
                    }
                }
            }
            catch (Exception e)
            {
                ShowException("Error moving to next record", e);
            }

            if (CurrentReport.Exhausted)
            {
                ShowMessage("End", "End of Failures");
            }

            StringBuilder info = new StringBuilder();

            info.Append(CurrentReport.DescribeProgress());

            if (skipped > 0)
            {
                info.Append(" Skipped " + skipped);
            }
            if (updated > 0)
            {
                info.Append(" Auto Updated " + updated);
            }

            _info.Text = info.ToString();
        }
예제 #2
0
 private void GoTo(int page)
 {
     if (CurrentReport == null)
     {
         return;
     }
     try
     {
         CurrentReport.GoTo(page);
         _info.Text = CurrentReport.DescribeProgress();
         SetupToShow(CurrentReport.Current);
     }
     catch (Exception e)
     {
         ShowException("Failed to GoTo", e);
     }
 }