private void BgCalcs(object sender)
        {
            var calc = CreateCalculation(sender);

            var worker = new BackgroundWorker();

            worker.DoWork += (ss, ee) => calc.Perform(worker, ee);

            var pdForm = new WorkerForm(worker);

            pdForm.ShowDialog();

            if (pdForm.Result is TablesDump res)
            {
                ShowCalculationResult(res);
            }
            pdForm.Dispose();
        }
        private void SendToExcel()
        {
            var excelExporter = new ExcelExporter(dataTableConnection);

            var worker = new BackgroundWorker();

            worker.DoWork += (ss, ee) => excelExporter.Export(worker, ee);

            var workerForm = new WorkerForm(worker)
            {
                LoadingTitle = "Відбувається експорт..."
            };

            workerForm.ShowDialog();
            var result = workerForm.Result;

            workerForm.Dispose();

            if (result is Exception exc)
            {
                throw exc;
            }
        }