diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-06 19:50:00 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-06 19:50:00 +0300 |
commit | 0288ae0a185095d182dfc18af6709bac7159f5e0 (patch) | |
tree | d3ae39fa9489888c077a06ae6cd78898573d7403 /Source/Assistant/SkuAssist.cs | |
parent | c061564c27834ebb8ff607491194f88fa3990a57 (diff) |
Add IsRehauSku() method
Diffstat (limited to 'Source/Assistant/SkuAssist.cs')
-rw-r--r-- | Source/Assistant/SkuAssist.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Assistant/SkuAssist.cs b/Source/Assistant/SkuAssist.cs index bd757b0..bfe7b90 100644 --- a/Source/Assistant/SkuAssist.cs +++ b/Source/Assistant/SkuAssist.cs @@ -48,7 +48,7 @@ namespace Rehau.Sku.Assist IProduct product = storeResponse .Ecommerce .Impressions - .Where(p => Regex.IsMatch(p.Id, @"\d{11}", RegexOptions.None)) + .Where(p => p.Id.IsRehauSku()) .FirstOrDefault(); return product; @@ -94,5 +94,12 @@ namespace Rehau.Sku.Assist return ExcelError.ExcelErrorValue; } } + + public static bool IsRehauSku(this string line) + { + return Regex.IsMatch(line, @"\d{11}") && + line[0].Equals('1') && + line[7].Equals('1'); + } } }
\ No newline at end of file |