RhSolutions-AddIn/src/PriceListTools/ConvertTool.cs
2022-02-02 18:05:49 +03:00

43 lines
1.1 KiB
C#

using RehauSku.Interface;
using System;
namespace RehauSku.PriceListTools
{
internal class ConvertTool : AbstractTool
{
private SourcePriceList Current;
public void GetCurrent()
{
try
{
Current = new SourcePriceList(ExcelApp.ActiveWorkbook);
}
catch (Exception exception)
{
System.Windows.Forms.MessageBox.Show
(exception.Message,
"Ошибка распознавания",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Information);
throw exception;
}
}
public void FillTarget()
{
ProgressBar bar = new ProgressBar(Current.PositionAmount.Count);
foreach (var kvp in Current.PositionAmount)
{
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);
bar.DoProgress();
}
FilterByAmount();
Dialog.SaveWorkbookAs();
}
}
}