Add convert Tool
This commit is contained in:
parent
71fcd9ee86
commit
722de64dad
@ -6,6 +6,27 @@ using System.Linq;
|
||||
|
||||
namespace RehauSku.PriceListTools
|
||||
{
|
||||
internal class ConvertTool : PriceListTool
|
||||
{
|
||||
private Source Current;
|
||||
|
||||
public void GetCurrent()
|
||||
{
|
||||
Current = new Source(ExcelApp.ActiveWorkbook);
|
||||
}
|
||||
|
||||
public void FillTarget()
|
||||
{
|
||||
ExcelApp.ScreenUpdating = false;
|
||||
FillColumn(Current.SkuAmount, TargetFile.amountCell.Column);
|
||||
FilterByAmount();
|
||||
ExcelApp.ScreenUpdating = true;
|
||||
|
||||
Forms.Dialog.SaveWorkbookAs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal abstract class PriceListTool
|
||||
{
|
||||
protected private Application ExcelApp = (Application)ExcelDnaUtil.Application;
|
||||
|
@ -20,13 +20,14 @@ namespace RehauSku.Ribbon
|
||||
<tab id='rau' label='REHAU'>
|
||||
<group id='priceList' label='Прайс-лист'>
|
||||
<button id='exportToPrice' label='Экспорт в новый файл' size='normal' imageMso='PivotExportToExcel' onAction='OnExportPressed'/>
|
||||
<button id='convertPrice' label='Обновить прайс-лист' size='normal' imageMso='FileUpdate' onAction='OnConvertPressed'/>
|
||||
<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='large' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/>
|
||||
<button id='setPriceList' label='Указать путь к шаблону' size='large' imageMso='CurrentViewSettings' onAction='OnSetPricePressed'/>
|
||||
</group>
|
||||
</tab>
|
||||
</tabs>
|
||||
@ -80,6 +81,15 @@ namespace RehauSku.Ribbon
|
||||
}
|
||||
}
|
||||
|
||||
public void OnConvertPressed(IRibbonControl control)
|
||||
{
|
||||
ConvertTool convertTool = new ConvertTool();
|
||||
|
||||
convertTool.GetCurrent();
|
||||
convertTool.OpenNewPrice();
|
||||
convertTool.FillTarget();
|
||||
}
|
||||
|
||||
public void OnSetPricePressed(IRibbonControl control)
|
||||
{
|
||||
string path = Dialog.GetFilePath();
|
||||
|
Loading…
Reference in New Issue
Block a user