Refactoring
This commit is contained in:
parent
51636ca61a
commit
f6534fc8c7
@ -1,5 +1,4 @@
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
|
||||
namespace RhSolutions.Services;
|
||||
|
||||
@ -95,7 +94,7 @@ public class GuessReader : IReader
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ProductSku.TryParse(currentCell.ToString(), out IEnumerable<ProductSku> skus))
|
||||
if (ProductSku.TryParse(currentCell.ToString(), out _))
|
||||
{
|
||||
successCounter++;
|
||||
}
|
||||
@ -120,14 +119,20 @@ public class GuessReader : IReader
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int row = 1; row < column.Rows.Count + 1; row++)
|
||||
if (column.Rows.Count == 1)
|
||||
{
|
||||
object currentCell = column.Rows.Count == 1 ? cells : cells[row, 1];
|
||||
if (currentCell == null)
|
||||
{
|
||||
continue;
|
||||
double? value = cells as double?;
|
||||
|
||||
return value != null
|
||||
&& value != 0
|
||||
&& value < maxValue;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
for (int row = 1; row < column.Rows.Count + 1; row++)
|
||||
{
|
||||
object currentCell = cells[row, 1];
|
||||
double? value = currentCell as double?;
|
||||
|
||||
if (value == null || value == 0)
|
||||
@ -140,11 +145,6 @@ public class GuessReader : IReader
|
||||
return false;
|
||||
}
|
||||
|
||||
if (column.Rows.Count == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (++successCounter > 1)
|
||||
{
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user