fix(scheduleSync, templateSync): фильтр шаблонов и расписаний без учета ЗО в префиксе (имени)

This commit is contained in:
Mikhail Trubnikov
2024-02-15 09:21:01 +10:00
parent f217b8dc51
commit f4304ea45a
2 changed files with 9 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ using PARR.DAL.Services.Interfaces;
using PARR.EsppScheduleSync.Domain;
using PARR.EsppScheduleSync.Settings;
using PARR.EsppSync;
using System.Linq;
namespace PARR.EsppScheduleSync
{
@@ -257,10 +258,13 @@ namespace PARR.EsppScheduleSync
{
var currentCulture = Thread.CurrentThread.CurrentCulture;
if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) && name.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture))
//if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixName) && name.StartsWith(settingsFromDb.TemplatePrefixName, true, currentCulture))
// return true;
if (!string.IsNullOrEmpty(settingsFromDb.TemplatePrefixWithoutVariable) && name.Contains(settingsFromDb.TemplatePrefixWithoutVariable, StringComparison.CurrentCultureIgnoreCase))
return true;
logger.LogWarning($"Имя шаблона или расписания не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixName}). {name} игнорирован");
logger.LogWarning($"Имя шаблона или расписания не соответствует обязательному префиксу({settingsFromDb.TemplatePrefixWithoutVariable}). {name} игнорирован");
return false;
}