RhSolutions-AddIn/RhSolutions.AddIn/Tools/ConvertTool.cs

14 lines
467 B
C#
Raw Permalink Normal View History

2024-11-09 22:59:46 +03:00
namespace RhSolutions.Tools;
2023-04-06 08:29:39 +03:00
2024-11-09 22:59:46 +03:00
internal class ConvertTool : ReaderWriterTool, ITool
2023-04-06 08:29:39 +03:00
{
2024-11-09 22:59:46 +03:00
public void Execute()
2023-04-06 08:29:39 +03:00
{
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
2023-05-22 07:39:48 +03:00
_reader = _readerFactory.GetReader("Excel");
2023-05-23 07:33:40 +03:00
var products = _reader.ReadProducts(new[] { worksheet });
2023-06-21 16:30:16 +03:00
_writer = _writerFactory.GetWriter("NewPrice");
2023-04-06 08:29:39 +03:00
_writer.WriteProducts(products);
}
}