Rename Sku class

This commit is contained in:
Sergey Chebotar 2022-12-20 12:03:20 +03:00
parent bfada8d605
commit 3d186c22e8
3 changed files with 14 additions and 13 deletions

View File

@ -2,18 +2,18 @@
namespace RhSolutions
{
internal class RauSku
internal class Sku
{
public string Sku { get; private set; }
public string Article { get; private set; }
public string Variant { get; private set; }
public RauSku(string sku, string variant)
public Sku(string article, string variant)
{
Sku = sku;
Article = article;
Variant = variant;
}
public static bool TryParse(string line, out RauSku rehauSku)
public static bool TryParse(string line, out Sku rehauSku)
{
Match match;
match = Regex.Match(line, @"\b[1]\d{6}[1]\d{3}\b");
@ -21,7 +21,7 @@ namespace RhSolutions
{
string sku = match.Value.Substring(1, 6);
string variant = match.Value.Substring(8, 3);
rehauSku = new RauSku(sku, variant);
rehauSku = new Sku(sku, variant);
return true;
}
@ -30,7 +30,7 @@ namespace RhSolutions
{
string sku = match.Value.Substring(0, 6);
string variant = match.Value.Substring(7, 3);
rehauSku = new RauSku(sku, variant);
rehauSku = new Sku(sku, variant);
return true;
}
@ -39,7 +39,7 @@ namespace RhSolutions
{
string sku = match.Value.Substring(0, 6);
string variant = match.Value.Substring(6, 3);
rehauSku = new RauSku(sku, variant);
rehauSku = new Sku(sku, variant);
return true;
}
@ -48,7 +48,7 @@ namespace RhSolutions
{
string sku = match.Value.Substring(0, 6);
string variant = "001";
rehauSku = new RauSku(sku, variant);
rehauSku = new Sku(sku, variant);
return true;
}
@ -61,7 +61,7 @@ namespace RhSolutions
public override string ToString()
{
return $"1{Sku}1{Variant}";
return $"1{Article}1{Variant}";
}
}
}

View File

@ -56,7 +56,7 @@ namespace RhSolutions.PriceListTools
{
object current = cells[row, column];
if (RauSku.TryParse(current.ToString(), out RauSku rauSku))
if (Sku.TryParse(current.ToString(), out Sku rauSku))
{
sku = rauSku.ToString();
}

View File

@ -78,7 +78,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AddIn\EventsUtil.cs" />
<Compile Include="AddIn\RehauSku.cs" />
<Compile Include="AddIn\RhDatabaseClient.cs" />
<Compile Include="AddIn\Sku.cs" />
<Compile Include="Interface\StatusbarBase.cs" />
<Compile Include="Interface\Dialog.cs" />
<Compile Include="AddIn\RegistryUtil.cs" />