diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-22 17:07:37 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-22 17:07:37 +0300 |
commit | ce5597d042062c820288c63b4e571ee77ac23ab0 (patch) | |
tree | 9400511fce89ae4b6d4df205b605f560778dcb57 /Source/DataExport | |
parent | f97d344f39c46b5e2f883765e8859e78007a11b0 (diff) |
RegistryUtil and some fixes
Diffstat (limited to 'Source/DataExport')
-rw-r--r-- | Source/DataExport/Exporter.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/DataExport/Exporter.cs b/Source/DataExport/Exporter.cs index 483dd0e..95b3186 100644 --- a/Source/DataExport/Exporter.cs +++ b/Source/DataExport/Exporter.cs @@ -34,7 +34,7 @@ namespace RehauSku.DataExport SelectedCells.GetLength(1) == 2; } - public void FillSkuAmountDict() + private void FillSkuAmountDict() { SkuAmount = new Dictionary<string, double>(); int rowsCount = SelectedCells.GetLength(0); @@ -73,20 +73,22 @@ namespace RehauSku.DataExport } } - public void FillPriceList() + public void FillNewPriceList() { + FillSkuAmountDict(); string exportFile = _GetExportFullPath(); File.Copy(RegistryUtil.PriceListPath, exportFile, true); Workbook wb = xlApp.Workbooks.Open(exportFile); Worksheet ws = wb.ActiveSheet; - Range amountCell = ws.Cells.Find("Кол-во"); + int amountColumn = ws.Cells.Find("Кол-во").Column; + int skuColumn = ws.Cells.Find("Актуальный материал").Column; foreach (KeyValuePair<string, double> kvp in SkuAmount) { - Range cell = ws.Cells.Find(kvp.Key); - ws.Cells[cell.Row, amountCell.Column].Value = kvp.Value; + Range cell = ws.Columns[skuColumn].Find(kvp.Key); + ws.Cells[cell.Row, amountColumn].Value = kvp.Value; } ws.Cells.AutoFilter(7, "<>"); |