-
Notifications
You must be signed in to change notification settings - Fork 4
Theme Wein
lukmay edited this page Dec 16, 2023
·
2 revisions
If an accommodation has an altitude value below or equal to 900 and if the accommodation's DistrictId
exists in a predefined wine list the theme "Wein" is added to the ThemeIds
. More detail below.
The code checks the altitude
of the accommodation, and if the value is less than or equal to 900, it proceeds to the next step.
The code loads a predefined XML file, the "winelist," which contains data about wine-related districts. It then checks if the accommodation's DistrictId
matches any entry in the "winelist."
The Code:
Is implemented here.
var weinaltitude = myacco.Altitude;
if (weinaltitude != null)
{
int weinaltitudeint = Convert.ToInt32(weinaltitude);
if (weinaltitudeint <= 900)
{
//XDocument mywinelist = XDocument.Load(xmldir + "Wine.xml");
//In Weinliste schauen
var isinwinelist = mywinelist.Root.Elements("Fraction").Where(x => x.Value == myacco.DistrictId).FirstOrDefault();
if (isinwinelist != null)
{
myacco.ThemeIds.Add("Wein");
}
}
}
This wiki contains additional information about the Open Data Hub alongside the Open Data Hub - Official Documentation 🔗 .