aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2021-12-07 08:27:30 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2021-12-07 08:27:30 +0300
commit878b5d2b6a4d807376f3255e52c8ac9ef97d6bc9 (patch)
tree27cac39f8bf373e9a2fd37bf7f22ff931ab3c18c
parent4743aa706e8342cdb3202c59e82bddef277cabfa (diff)
Rename export file name field name
-rw-r--r--Source/DataExport/DataWriter.cs25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/DataExport/DataWriter.cs b/Source/DataExport/DataWriter.cs
index c024a22..7095577 100644
--- a/Source/DataExport/DataWriter.cs
+++ b/Source/DataExport/DataWriter.cs
@@ -10,12 +10,12 @@ namespace Rehau.Sku.Assist
private Application xlApp;
private Dictionary<string, double> SkuAmount { get; set; }
private object[,] SelectedCells { get; set; }
- private string FileName { get; set; }
+ private string ExportFileName { get; set; }
public DataWriter()
{
this.xlApp = (Application)ExcelDnaUtil.Application;
- this.FileName = AddIn.priceListPath;
+ this.ExportFileName = AddIn.priceListPath;
GetSelectedCells();
}
@@ -71,9 +71,24 @@ namespace Rehau.Sku.Assist
}
}
- public void GetPriceListWB()
- {
- Workbook wb = xlApp.Workbooks.Open(FileName);
+ public void FillPriceList()
+ {
+ Workbook wb = xlApp.Workbooks.Open(ExportFileName);
+ Worksheet ws = wb.ActiveSheet;
+
+ Range amountCell = ws.Cells.Find("Кол-во");
+
+ foreach (KeyValuePair<string,double> kvp in SkuAmount)
+ {
+ Range cell = ws.Cells.Find(kvp.Key);
+ ws.Cells[cell.Row, amountCell.Column].Value = kvp.Value;
+ }
+
+ //Range filter = ws.Cells[amountCell.Row + 1, amountCell.Column];
+ //filter.AutoFilter(1, "<>");
+
+ wb.Save();
+ wb.Close();
}
public void Dispose()