0
0
RhSolutions-Api/RhSolutions.QueryModifiers/DrinkingWaterHeatingFittings/Coupling.cs

24 lines
734 B
C#
Raw Normal View History

2023-10-13 15:04:27 +03:00
namespace RhSolutions.QueryModifiers.DrinkingWaterHeatingFittings;
public class Coupling : DrinkingWaterHeatingFitting
{
protected override string _title => "Муфта соединительная";
protected override string? BuildRhSolutionsName(string query)
{
var diameters = _diameter.Matches(query);
if (diameters.Count == 0)
{
return null;
}
if (diameters.Count < 2 ||
diameters.Count > 1 && diameters[0].Groups["Diameter"].Value == diameters[1].Groups["Diameter"].Value)
{
return $"{_title} равнопроходная {diameters[0].Groups["Diameter"]}";
}
else
{
return $"{_title} переходная {diameters[0].Groups["Diameter"]}-{diameters[1].Groups["Diameter"]}";
}
}
}