R3 processor
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using WebAPI.Models;
|
||||
using System.Text.RegularExpressions;
|
||||
using WebAPI.Models;
|
||||
|
||||
namespace DiunaBIWebAPI.dataProcessors;
|
||||
|
||||
@@ -172,4 +173,40 @@ public static class ProcessHelper
|
||||
}
|
||||
return codesList;
|
||||
}
|
||||
public static string? ExtractMonthFromLayerName(string layerName)
|
||||
{
|
||||
string pattern = @"L\d+-P-\d{4}/(\d{2})-";
|
||||
var match = Regex.Match(layerName, pattern);
|
||||
if (match.Success && match.Groups.Count > 1)
|
||||
{
|
||||
return match.Groups[1].Value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetSheetName(int month, int year)
|
||||
{
|
||||
if (month < 1 || month > 12)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(month), "Month must be between 1 and 12.");
|
||||
}
|
||||
|
||||
var polishMonths = new[]
|
||||
{
|
||||
"Styczen",
|
||||
"Luty",
|
||||
"Marzec",
|
||||
"Kwiecien",
|
||||
"Maj",
|
||||
"Czerwiec",
|
||||
"Lipiec",
|
||||
"Sierpien",
|
||||
"Wrzesien",
|
||||
"Pazdziernik",
|
||||
"Listopad",
|
||||
"Grudzien"
|
||||
};
|
||||
var monthName = polishMonths[month - 1];
|
||||
return $"{monthName}_{year}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user