Compare commits

...

2 Commits

Author SHA1 Message Date
dfe4ef7b5b Fix merged column header data format 2024-05-27 23:44:59 +03:00
dc1e8616a6 Fix merged column ordering 2024-05-27 23:39:43 +03:00
4 changed files with 8 additions and 7 deletions

View File

@ -79,7 +79,7 @@ public class ExcelReader : IReader, IDisposable
return readResult;
}
public List<(string, Dictionary<Product, double>)>
public IEnumerable<(string, Dictionary<Product, double>)>
ReadProducts(IEnumerable<Worksheet> worksheets)
{
List<(string, Dictionary<Product, double>)> result = new();
@ -151,10 +151,10 @@ public class ExcelReader : IReader, IDisposable
result.Add((wbName, readResult));
}
return result;
return result.OrderBy(x => x.Item1);
}
public List<(string, Dictionary<Product, double>)> ReadProducts(string[] files)
public IEnumerable<(string, Dictionary<Product, double>)> ReadProducts(string[] files)
{
HashSet<string> openedFiles = RhSolutionsAddIn.Excel.Workbooks
.Cast<Workbook>()

View File

@ -70,6 +70,7 @@ namespace RhSolutions.Services
.Insert(XlInsertShiftDirection.xlShiftToRight, XlInsertFormatOrigin.xlFormatFromRightOrBelow);
Range newColumnHeader = _worksheet.Cells[_amountCell.Row, _amountCell.Column - 1];
newColumnHeader.NumberFormat = "@";
newColumnHeader.Value2 = $"{product.Item1}";
newColumnHeader.WrapText = true;

View File

@ -192,7 +192,7 @@ public class GuessReader : IReader
return result;
}
public List<(string, Dictionary<Product, double>)> ReadProducts(IEnumerable<Worksheet> worksheets)
public IEnumerable<(string, Dictionary<Product, double>)> ReadProducts(IEnumerable<Worksheet> worksheets)
{
List<(string, Dictionary<Product, double>)> result = new();
foreach (Worksheet worksheet in worksheets)
@ -206,7 +206,7 @@ public class GuessReader : IReader
return result;
}
public List<(string, Dictionary<Product, double>)> ReadProducts(string[] files)
public IEnumerable<(string, Dictionary<Product, double>)> ReadProducts(string[] files)
{
_progressBar = new("Открываю исходные файлы...", files.Length);
List<Worksheet> worksheets = new();

View File

@ -3,7 +3,7 @@
public interface IReader : IDisposable
{
public Dictionary<Product, double> ReadProducts(Range range);
public List<(string, Dictionary<Product, double>)> ReadProducts(IEnumerable<Worksheet> worksheets);
public List<(string, Dictionary<Product, double>)> ReadProducts(string[] files);
public IEnumerable<(string, Dictionary<Product, double>)> ReadProducts(IEnumerable<Worksheet> worksheets);
public IEnumerable<(string, Dictionary<Product, double>)> ReadProducts(string[] files);
new void Dispose();
}