aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools/AbstractTool.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/PriceListTools/AbstractTool.cs')
-rw-r--r--src/PriceListTools/AbstractTool.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/PriceListTools/AbstractTool.cs b/src/PriceListTools/AbstractTool.cs
index f312e95..0ffabd2 100644
--- a/src/PriceListTools/AbstractTool.cs
+++ b/src/PriceListTools/AbstractTool.cs
@@ -135,21 +135,25 @@ namespace RehauSku.PriceListTools
protected int? GetPositionRow(Range range, string sku, string group)
{
Range found = range.Find(sku);
+ string foundGroupValue;
if (found == null)
{
return null;
}
- int firstFoundRow = found.Row;
+ int firstFoundRow = found.Row;
+
+ if (string.IsNullOrEmpty(group))
+ {
+ return found.Row;
+ }
while (true)
{
- Range groupCell = TargetFile.Sheet.Cells[found.Row, TargetFile.GroupCell.Column];
+ foundGroupValue = TargetFile.Sheet.Cells[found.Row, TargetFile.GroupCell.Column].Value2.ToString();
- if (string.IsNullOrEmpty(group) ||
- string.IsNullOrEmpty(groupCell.Value2.ToString()) ||
- group.Equals(groupCell.Value2.ToString()))
+ if (group.Equals(foundGroupValue))
{
return found.Row;
}