Handling Bonus Vacanze Tag Logic - noi-techpark/opendatahub-docs GitHub Wiki
If an accommodation possesses the Feature D448B037F37843B3B49C15CAFBBC5669
, the SmgTag Bonus Vacanze
is added. Conversely, if the feature is absent, the tag is removed to ensure accurate representation.
The Code:
//Spezialfall Covid 19
var bonusvacanze = myacco.Features.Where(x => x.Id == "D448B037F37843B3B49C15CAFBBC5669").Count();
if(bonusvacanze > 0)
{
//Füge SMGTag Balance hinzu
if (myacco.SmgTags == null)
myacco.SmgTags = new List<string>();
if (!myacco.SmgTags.Contains("Bonus Vacanze"))
myacco.SmgTags.Add("Bonus Vacanze");
}
if(bonusvacanze == 0)
{
if(myacco.SmgTags != null)
{
if (myacco.SmgTags.Contains("Bonus Vacanze"))
myacco.SmgTags.Remove("Bonus Vacanze");
}
}