new processor: T3-MultiSourceCopySelectedCodes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user