private XmlElement createElementHourly(DatePerHour date, DateTime dateTime, XmlDocument docSave) { XmlElement h2o = docSave.CreateElement("date"); h2o.SetAttribute("day", Convert.ToString(dateTime.Day)); h2o.SetAttribute("month", Convert.ToString(dateTime.Month)); h2o.SetAttribute("year", Convert.ToString(dateTime.Year)); XmlElement hour = docSave.CreateElement("hour"); hour.InnerText = date.option; XmlElement average = docSave.CreateElement("average"); average.InnerText = date.average; XmlElement max = docSave.CreateElement("max"); max.InnerText = date.max; XmlElement min = docSave.CreateElement("min"); min.InnerText = date.min; h2o.AppendChild(hour); h2o.AppendChild(average); h2o.AppendChild(max); h2o.AppendChild(min); return(h2o); }
private XmlElement createElementDaily(DatePerHour date, XmlDocument docSave) { XmlElement day = docSave.CreateElement("date"); day.SetAttribute("day", date.option); XmlElement average = docSave.CreateElement("average"); average.InnerText = date.average; XmlElement max = docSave.CreateElement("max"); max.InnerText = date.max; XmlElement min = docSave.CreateElement("min"); min.InnerText = date.min; day.AppendChild(average); day.AppendChild(max); day.AppendChild(min); return(day); }