2022-02-02 09:46:47 +03:00
|
|
|
|
using RehauSku.Interface;
|
|
|
|
|
using System;
|
2022-01-28 09:27:19 +03:00
|
|
|
|
|
|
|
|
|
namespace RehauSku.PriceListTools
|
2022-01-28 09:16:10 +03:00
|
|
|
|
{
|
2022-02-02 18:02:17 +03:00
|
|
|
|
internal class ConvertTool : AbstractTool
|
2022-01-28 09:16:10 +03:00
|
|
|
|
{
|
|
|
|
|
private Source Current;
|
|
|
|
|
|
|
|
|
|
public void GetCurrent()
|
|
|
|
|
{
|
2022-01-28 09:27:19 +03:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Current = new Source(ExcelApp.ActiveWorkbook);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
{
|
|
|
|
|
System.Windows.Forms.MessageBox.Show
|
|
|
|
|
(exception.Message,
|
|
|
|
|
"Ошибка распознавания",
|
|
|
|
|
System.Windows.Forms.MessageBoxButtons.OK,
|
|
|
|
|
System.Windows.Forms.MessageBoxIcon.Information);
|
|
|
|
|
throw exception;
|
|
|
|
|
}
|
2022-01-28 09:16:10 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void FillTarget()
|
|
|
|
|
{
|
2022-02-02 10:23:50 +03:00
|
|
|
|
ProgressBar bar = new ProgressBar(Current.PositionAmount.Count);
|
|
|
|
|
|
2022-02-01 20:32:29 +03:00
|
|
|
|
foreach (var kvp in Current.PositionAmount)
|
2022-02-02 10:23:50 +03:00
|
|
|
|
{
|
2022-02-01 20:32:29 +03:00
|
|
|
|
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);
|
2022-02-02 10:23:50 +03:00
|
|
|
|
bar.DoProgress();
|
|
|
|
|
}
|
2022-02-01 20:32:29 +03:00
|
|
|
|
|
2022-01-28 09:16:10 +03:00
|
|
|
|
FilterByAmount();
|
|
|
|
|
|
2022-02-02 09:46:47 +03:00
|
|
|
|
Dialog.SaveWorkbookAs();
|
2022-01-28 09:16:10 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|