Skip to content

Theme Wandern

lukmay edited this page Dec 16, 2023 · 2 revisions

If the accommodation has all the features listed below assigned, the theme "Wandern" is added to the ThemeIds.

  • All of the following features are mandatory:
    • 0A6193AD6EBC4BC18E83D7CEEEF53E45
    • 42E4EFB64AD14393BC28DBC20F273B9D (DE = Geführte Touren und Wanderungen, IT = Escursioni e gite guidate, EN = Guided tours and hikes)

The Code:

Is implemented here.

if (myacco.Features != null)
{
    var wandern = myacco.Features.Where(x =>
        x.Id == "0A6193AD6EBC4BC18E83D7CEEEF53E45" ||
        x.Id == "42E4EFB64AD14393BC28DBC20F273B9D");

    bool wandern1 = false;
    bool wandern2 = false;

    if (wandern.Count() > 0)
    {
        foreach (var mywandern in wandern)
        {
            if (mywandern.Id == "0A6193AD6EBC4BC18E83D7CEEEF53E45")
                wandern1 = true;
            if (mywandern.Id == "42E4EFB64AD14393BC28DBC20F273B9D")
                wandern2 = true;
        }

        if (wandern1 && wandern2)
        {
            myacco.ThemeIds.Add("Wandern");
        }
    }
}
Clone this wiki locally