Copy pricelist file
This commit is contained in:
parent
bc3421e67f
commit
f8ec152378
@ -11,7 +11,7 @@
|
||||
- Отображение цены найденного продукта с помощью формулы `=RAUPRICE()`
|
||||
|
||||
## Работа без установки
|
||||
1. Запустить файл `Rehau.Sku.Assist-AddIn-packed.xll` или `Rehau.Sku.Assist-AddIn64-packed.xll` в зависимости от архитектуры приложения
|
||||
1. Запустить файл `RehauSku.Assist-AddIn-packed.xll` или `RehauSku.Assist-AddIn64-packed.xll` в зависимости от архитектуры приложения
|
||||
2. Включить надстройку для данного сеанса в извещении системы безопасности
|
||||
|
||||
## Постоянная установка
|
||||
|
@ -12,12 +12,12 @@ namespace RehauSku.DataExport
|
||||
private Application xlApp;
|
||||
private Dictionary<string, double> SkuAmount { get; set; }
|
||||
private object[,] SelectedCells { get; set; }
|
||||
private string WorkingFileName { get; set; }
|
||||
private string ActiveFilePath { get; set; }
|
||||
|
||||
public Exporter()
|
||||
{
|
||||
this.xlApp = (Application)ExcelDnaUtil.Application;
|
||||
this.WorkingFileName = xlApp.ActiveWorkbook.FullName;
|
||||
this.ActiveFilePath = xlApp.ActiveWorkbook.Path;
|
||||
|
||||
GetSelectedCells();
|
||||
}
|
||||
@ -73,32 +73,41 @@ namespace RehauSku.DataExport
|
||||
}
|
||||
}
|
||||
|
||||
//public void FillPriceList()
|
||||
public void FillPriceList()
|
||||
{
|
||||
|
||||
File.Copy(AddIn.priceListPath, _GetExportFileDir());
|
||||
|
||||
//Workbook wb = xlApp.Workbooks.Open(PriceListFilePath);
|
||||
//Worksheet ws = wb.ActiveSheet;
|
||||
|
||||
//Range amountCell = ws.Cells.Find("Кол-во");
|
||||
|
||||
//foreach (KeyValuePair<string, double> kvp in SkuAmount)
|
||||
//{
|
||||
// string exportFileName = "rehau-export_" + DateTime.Now + ".xlsm";
|
||||
// string workingDir = xlApp.ActiveWorkbook.Path;
|
||||
|
||||
// //File.Copy(Path.GetFullPath(PriceListFilePath), Path.Combine(WorkingFileName, exportFileName + ".xlsm"));
|
||||
|
||||
|
||||
// Workbook wb = xlApp.Workbooks.Open(PriceListFilePath);
|
||||
// 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.Range["H16:H4058"];
|
||||
// ws.Cells.AutoFilter(7, "<>");
|
||||
|
||||
// //wb.Save();
|
||||
// //wb.Close();
|
||||
//}
|
||||
|
||||
////Range filter = ws.Range["H16:H4058"];
|
||||
//ws.Cells.AutoFilter(7, "<>");
|
||||
|
||||
////wb.Save();
|
||||
////wb.Close();
|
||||
}
|
||||
|
||||
private string _GetExportFileDir()
|
||||
{
|
||||
string fileExtension = Path.GetExtension(AddIn.priceListPath),
|
||||
exportFileName = "rehau-export-" + DateTime.Now.ToShortDateString(),
|
||||
exportFilePath = !string.IsNullOrEmpty(ActiveFilePath) ?
|
||||
ActiveFilePath :
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
|
||||
return Path.Combine(exportFilePath, exportFileName) + fileExtension;
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
@ -37,7 +37,7 @@ namespace RehauSku.Ribbon
|
||||
else
|
||||
{
|
||||
dw.FillSkuAmountDict();
|
||||
//dw.FillPriceList();
|
||||
dw.FillPriceList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user