Skip to content

Theme Sustainability

lukmay edited this page Dec 16, 2023 · 3 revisions

If an accommodation has the MarketingGroupId 3EA6116A6103498799B642C9C56D8301 or if any of the following tags are assigned:

  • "bio hotels südtirol"
  • "ecolabel hotels"
  • "gstc hotels"
  • "klimahotel"

The theme "Sustainability" is added to the ThemeIds.


The Code:

Is implemented here.

List<string> sustainabilityodhtagtocheck = new List<string>();
sustainabilityodhtagtocheck.Add("bio hotels südtirol"); //Bozen
sustainabilityodhtagtocheck.Add("ecolabel hotels"); //Brixen
sustainabilityodhtagtocheck.Add("gstc hotels"); //Bruneck            
sustainabilityodhtagtocheck.Add("klimahotel"); //Sterzing

//check if one of this odhtags is assigned

var sustainabilityfeaturecheck = myacco.MarketingGroupIds != null ? myacco.MarketingGroupIds.Where(x => x == "3EA6116A6103498799B642C9C56D8301").Count() : 0;
var sustainabilitytagintersection = myacco.SmgTags != null && myacco.SmgTags.Count > 0 ? sustainabilityodhtagtocheck.Intersect(myacco.SmgTags).Count() : 0;

if (sustainabilityfeaturecheck > 0 || sustainabilitytagintersection > 0)
    myacco.ThemeIds.Add("Sustainability");
Clone this wiki locally