How to make an if statement to show xml attribute based on current time

imimeshooms

New Member
I have a XML like this:\[code\]<PrayerTime Day ="1" Month="5" Fajr="07:00" Sunrise="09:00" Zuhr="14:00"/>\[/code\]A class like this:\[code\]public class PrayerTime{ public string Fajr { get; set; } public string Sunrise { get; set; } public string Zuhr { get; set; }}\[/code\]And something to get the value like this:\[code\]XDocument loadedCustomData = http://stackoverflow.com/questions/10485767/XDocument.Load("WimPrayerTime.xml");var filteredData = http://stackoverflow.com/questions/10485767/from c in loadedCustomData.Descendants("PrayerTime") where c.Attribute("Day").Value =http://stackoverflow.com/questions/10485767/= myDay.Day.ToString() && c.Attribute("Moth").Value =http://stackoverflow.com/questions/10485767/= myDay.Month.ToString() select new PrayerTime() { Fajr = c.Attribute("Fajr").Value, Sunrise = c.Attribute("Sunrise").Value, };myTextBox.Text = filteredData.First().Fajr;\[/code\]How can i based by current time of day say that if time is between the value of Fajr and the Value of Sunrise, then myTextBox should show the value of Fajr.If value of current time is between sunrise and Zuhr, show Zuhr?How can i get it to show the attribute name in myTextBox2?For example, myTextBox shows value "07:00", and myTextBox2 shows "Fajr"?
 
Back
Top