Compare commits

...

3 Commits

Author SHA1 Message Date
Sergey Chebotar
6fdc410c8f Merge branch 'master' of https://gitea.cebotari.ru/chebser/RhSolutions-AddIn 2023-06-21 17:03:07 +03:00
Sergey Chebotar
cd657e10b4 Fill cells with null if amount is zero 2023-06-21 16:45:38 +03:00
Sergey Chebotar
e4aa8dff93 Fix Application using ordering 2023-06-21 16:30:16 +03:00
6 changed files with 13 additions and 6 deletions

View File

@ -134,7 +134,14 @@ namespace RhSolutions.Services
}
else
{
cell.Value2 = amount;
if (amount == 0)
{
cell.Value2 = null;
}
else
{
cell.Value2 = amount;
}
}
}
}

View File

@ -19,8 +19,8 @@ internal class ConvertTool : Tool
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
_reader = _readerFactory.GetReader("Excel");
_writer = _writerFactory.GetWriter("NewPrice");
var products = _reader.ReadProducts(new[] { worksheet });
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}

View File

@ -17,8 +17,8 @@ internal class ExportTool : Tool
{
Application app = RhSolutionsAddIn.Excel.Application;
_reader = _readerFactory.GetReader("Excel");
_writer = _writerFactory.GetWriter("NewPrice");
var products = _reader.ReadProducts(app.Selection);
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}

View File

@ -15,8 +15,8 @@ internal class GuessTool : Tool
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
_reader = _readerFactory.GetReader("Guess");
_writer = _writerFactory.GetWriter("NewPrice");
var products = _reader.ReadProducts(new[] { worksheet });
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}

View File

@ -18,8 +18,8 @@ internal class MergeTool : Tool
IFileDialog dialog = RhSolutionsAddIn.ServiceProvider.GetRequiredService<IFileDialog>();
string[] files = dialog.GetFiles();
_reader = _readerFactory.GetReader("Excel");
_writer = _writerFactory.GetWriter("NewPrice");
var products = _reader.ReadProducts(files);
_writer = _writerFactory.GetWriter("NewPrice");
_writer.WriteProducts(products);
}
}

View File

@ -14,9 +14,9 @@ internal class SleevesTool : Tool
Application app = RhSolutionsAddIn.Excel.Application;
Worksheet worksheet = app.ActiveWorkbook.ActiveSheet;
_reader = _readerFactory.GetReader("Excel");
_writer = _writerFactory.GetWriter("CurrentPrice");
var products = _reader.ReadProducts(new[] { worksheet });
var sleeves = _sleevesCaluculator.CalculateSleeves(products.Select(p => p.Item2).First());
_writer = _writerFactory.GetWriter("CurrentPrice");
_writer.WriteProducts(sleeves);
}
}