Skip to content

Handling Bonus Vacanze Tag Logic

lukmay edited this page Aug 6, 2023 · 1 revision

Assignment Logic for SmgTag based on Feature

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");
    }
}
Clone this wiki locally