diff options
author | Serghei Cebotari <51533848+schebotar@users.noreply.github.com> | 2022-02-05 13:18:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-05 13:18:18 +0300 |
commit | ad7234fda7927c45e5ca457facae71a4b9be6b31 (patch) | |
tree | d9fc89b0e02a5fdc92d54674b7b48ad2d10859e4 /src/PriceListTools/ExportTool.cs | |
parent | 180807d749f4eb3a16c1f136d42b90ea2945008f (diff) | |
parent | eb6a28b955b5b179bd40f21dcf1daa6f9337765f (diff) |
Merge pull request #15 from schebotar/dev
Dev
Diffstat (limited to 'src/PriceListTools/ExportTool.cs')
-rw-r--r-- | src/PriceListTools/ExportTool.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/PriceListTools/ExportTool.cs b/src/PriceListTools/ExportTool.cs index bfb3d8a..f341671 100644 --- a/src/PriceListTools/ExportTool.cs +++ b/src/PriceListTools/ExportTool.cs @@ -1,37 +1,37 @@ using Microsoft.Office.Interop.Excel; -using RehauSku.Assistant; using System; using System.Collections.Generic; +using RehauSku.Interface; namespace RehauSku.PriceListTools { - internal class ExportTool : PriceListTool + internal class ExportTool : AbstractTool { private Dictionary<Position, double> PositionAmount; private Range Selection; - public void TryGetSelection() + public ExportTool() { Selection = ExcelApp.Selection; - - if (Selection == null || Selection.Columns.Count != 2) - { - throw new Exception("Неверный диапазон"); - } } public void FillTarget() { GetSelected(); - + ProgressBar = new ProgressBar("Заполняю строки...", PositionAmount.Count); + ResultBar = new ResultBar(); + foreach (var kvp in PositionAmount) { - FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column); + FillPositionAmountToColumns(kvp, TargetFile.amountCell.Column); + ProgressBar.Update(); } FilterByAmount(); + ResultBar.Update(); - Forms.Dialog.SaveWorkbookAs(); + Interface.Dialog.SaveWorkbookAs(); + ExcelApp.StatusBar = false; } private void GetSelected() |