Ejemplo n.º 1
0
        public static void ValidateBills(IBackgroundContext context, LpuExecParams executorParams)
        {
            if (context.CancellationPending) return;

            context.ProgressSeparator();
            context.ReportProgress(@"ПРОВЕРКА СЧЕТОВ");
            context.ReportProgress("");
            using (var dataContext = new BillsValidatorDataContext())
            {
                var dir = Properties.Settings.Default.DataDir;
                dataContext.Load(context, dir, dir, dir);
                if (context.CancellationPending) return;
                foreach (var bill in dataContext.Bills.TakeWhile(x => !context.CancellationPending))
                {
                    validateBill(context, dataContext, bill);
                }
            }
            context.ProgressSeparator('-');
        }