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

27 lines
766 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 diametersMatches = _diameter.Matches(query);
if (diametersMatches.Count == 0)
2023-10-13 15:04:27 +03:00
{
return null;
}
var diameters = diametersMatches.Select(x => x.Groups["Diameter"].Value)
.Take(2)
.OrderByDescending(x => int.Parse(x))
.ToArray();
if (diameters.Length == 1 || diameters[0] == diameters[1])
2023-10-13 15:04:27 +03:00
{
return $"{_title} равнопроходная {diameters[0]}";
2023-10-13 15:04:27 +03:00
}
else
{
return $"{_title} переходная {diameters[0]}-{diameters[1]}";
2023-10-13 15:04:27 +03:00
}
}
}