new processor: T3-MultiSourceCopySelectedCodes

This commit is contained in:
Michał Zieliński
2023-12-20 18:39:43 +01:00
parent d73d3ee345
commit be80c90657
4 changed files with 226 additions and 5 deletions

View File

@@ -108,7 +108,6 @@ namespace DiunaBIWebAPI.dataProcessors
break;
}
}
public static float? getValue(Record record, int number)
{
switch (number)
@@ -181,6 +180,30 @@ namespace DiunaBIWebAPI.dataProcessors
return null;
}
}
public static List<int> parseCodes(string codes)
{
List<int> codesList = new List<int>();
foreach (string code in codes.Split(';'))
{
string[] range = code.Split('-');
if (range.Length == 1)
{
codesList.Add(int.Parse(range[0]));
}
else if (range.Length == 2)
{
for (int i = int.Parse(range[0]); i <= int.Parse(range[1]); i++)
{
codesList.Add(i);
}
}
else
{
throw new Exception($"Invalid code range: {code}");
}
}
return codesList;
}
}
}