aboutsummaryrefslogtreecommitdiff
path: root/src/Ribbon/RibbonController.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2022-01-07 19:04:07 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2022-01-07 19:04:07 +0300
commit8672fa8f6b28ee3e3cf0d00e05e1b9d3ab7a2bfd (patch)
treeed7b5349784735a6eeb20eb8f4bd140c7f71e336 /src/Ribbon/RibbonController.cs
parentfbe97d706cb87374a469f2e7df5c177877d6616b (diff)
Add CombineTool for conjoining files into columns
Diffstat (limited to 'src/Ribbon/RibbonController.cs')
-rw-r--r--src/Ribbon/RibbonController.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/Ribbon/RibbonController.cs b/src/Ribbon/RibbonController.cs
index df6f327..ad27bc2 100644
--- a/src/Ribbon/RibbonController.cs
+++ b/src/Ribbon/RibbonController.cs
@@ -17,8 +17,11 @@ namespace RehauSku.Ribbon
<tabs>
<tab id='rau' label='REHAU'>
<group id='priceList' label='Прайс-лист'>
- <button id='exportToPrice' label='Экспорт в новый файл' size='normal' imageMso='PivotExportToExcel' onAction='OnExportPressed'/>
- <button id='mergeFiles' label='Объединить' size='normal' imageMso='Copy' onAction='OnMergePressed'/>
+ <button id='exportToPrice' label='Экспорт в новый файл' size='normal' imageMso='PivotExportToExcel' onAction='OnExportPressed'/>
+ <menu id='conjoinMenu' label='Объединить' imageMso='Copy'>
+ <button id='mergeFiles' label='Сложить' onAction='OnMergePressed'/>
+ <button id='combineFiles' label='По колонкам' onAction='OnCombinePressed'/>
+ </menu>
</group>
<group id='rausettings' label='Настройки'>
<button id='setPriceList' label='Файл прайс-листа' size='normal' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/>
@@ -29,14 +32,27 @@ namespace RehauSku.Ribbon
</customUI>";
}
+ // <dropDown id = 'dd1' label = 'Drop dynamic' getItemCount = 'fncGetItemCountDrop' getItemLabel = 'fncGetItemLabelDrop' onAction = 'fncOnActionDrop'/>
+
public void OnMergePressed(IRibbonControl control)
{
using (MergeTool mergeTool = new MergeTool())
{
string[] files = Dialog.GetMultiplyFiles();
- mergeTool.AddSkuAmountToDict(files);
+ mergeTool.CollectSkuAmount(files);
+ string exportFile = PriceListUtil.CreateNewExportFile();
+ mergeTool.ExportToFile(exportFile);
+ }
+ }
+
+ public void OnCombinePressed(IRibbonControl control)
+ {
+ using (CombineTool combineTool = new CombineTool())
+ {
+ string[] files = Dialog.GetMultiplyFiles();
+ combineTool.CollectSkuAmount(files);
string exportFile = PriceListUtil.CreateNewExportFile();
- mergeTool.ExportToNewFile(exportFile);
+ combineTool.ExportToFile(exportFile);
}
}