Verbesserung Perseh Import. Prüfe Anzahl neuer Bereiche vor dem Import. Wenn > 10 angelegt werden müssten, brich den Import ab
This commit is contained in:
@@ -1432,7 +1432,13 @@ namespace BeWo.Service.Plugins
|
||||
|
||||
var scDC = MapperFactory.SupportConceptDC_SupportConcept.MapToNewDC(supportConcept);
|
||||
|
||||
MatchZiele(hidc, scDC);
|
||||
var resultMessage = MatchZiele(hidc, scDC);
|
||||
|
||||
if (!String.IsNullOrEmpty(resultMessage))
|
||||
{
|
||||
result.ImportMessage = resultMessage;
|
||||
return result;
|
||||
}
|
||||
|
||||
result.ImportedSupportConcept = scDC;
|
||||
//result.ImportMessage = "Import erfolgreich";
|
||||
@@ -1440,7 +1446,7 @@ namespace BeWo.Service.Plugins
|
||||
return result;
|
||||
}
|
||||
|
||||
private void MatchZiele(HilfeplanImportDC hidc, SupportConceptDC supportConcept)
|
||||
private String MatchZiele(HilfeplanImportDC hidc, SupportConceptDC supportConcept)
|
||||
{
|
||||
var types = new List<ValueListEntryType>();
|
||||
types.Add(ValueListEntryType.SupportConceptGoalCategoryType);
|
||||
@@ -1451,6 +1457,24 @@ namespace BeWo.Service.Plugins
|
||||
{
|
||||
alleZiele = SortiereZieleNachHierarchie(alleZiele);
|
||||
|
||||
//Zähle neue Bereiche und importiere nur, wenn weniger als 11 gefunden wurden
|
||||
int count = 0;
|
||||
foreach (var importziel in hidc.Ziele)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(importziel.Bereich) && importziel.DoImport)
|
||||
{
|
||||
if (SucheBereichsZiel(alleZiele, importziel.Bereich) == null)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (count > 10)
|
||||
{
|
||||
return "Es wurden zu viele unbekannte Lebensbereiche gefunden. Bitte prüfen Sie, ob alle Bereiche korrekt angelegt sind.";
|
||||
}
|
||||
foreach (var importziel in hidc.Ziele)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(importziel.Bereich) && importziel.DoImport)
|
||||
@@ -1495,6 +1519,8 @@ namespace BeWo.Service.Plugins
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private ValueListEntryDC ErstelleBereichsZiel(string bereich)
|
||||
|
||||
Reference in New Issue
Block a user