forked from ddrilling/AsbCloudServer
Merge pull request '#11586758 Исправление импорта РТК план.' (#89) from fix/processmap_import into dev
Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/89
This commit is contained in:
commit
2ec88c49bc
@ -343,14 +343,15 @@ public class ProcessMapPlanImportService : IProcessMapPlanImportService
|
||||
|
||||
private static T GetCellValue<T>(IXLRow row, int columnNumber)
|
||||
{
|
||||
var cell = row.Cell(columnNumber);
|
||||
|
||||
if (cell.Value is T cellValue)
|
||||
try
|
||||
{
|
||||
return cellValue;
|
||||
var cell = row.Cell(columnNumber);
|
||||
return (T)Convert.ChangeType(cell.Value, typeof(T));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new FileFormatException(
|
||||
$"Лист {row.Worksheet.Name}. Ячейка: ({row.RowNumber()},{columnNumber}) содержит некорректное значение");
|
||||
}
|
||||
|
||||
throw new FileFormatException(
|
||||
$"Лист {row.Worksheet.Name}. Ячейка:{columnNumber},{row.RowNumber()} содержит некорректное значение");
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user