/// <summary> /// Gets the infograhic topics. /// </summary> /// <returns></returns> private IList <InfographicTopic> GetInfograhicTopics() { IList <InfographicTopic> topics = new List <InfographicTopic>(); NHibernate.IQuery query = null; var activeSections = GetActiveSections(ActiveReport, CurrentWebsite.Datasets); // Retrieve CMS Zone data from DB. using (var session = DataProvider.SessionFactory.OpenSession()) { var infectionTopicCategoryId = session.Query <TopicCategory>().SingleOrDefault(tc => tc.Name.Contains("Infections")).Id; query = session .CreateSQLQuery(sqlGetData) .SetResultTransformer(Transformers.AliasToBean(typeof(InfographicTopicDTO))); var topicDTOs = query.List <InfographicTopicDTO>(); foreach (var topicDTO in topicDTOs) { var topic = topics.FirstOrDefault(t => t.TopicCategory == topicDTO.TopicCategory); if (topic == null) { topic = new InfographicTopic() { RegionName = CurrentWebsite.GeographicDescription, SiteName = CurrentWebsite.HeaderTitle, SiteUrl = CurrentWebsite.HeaderTitle, ActiveSections = activeSections, TopicCategory = topicDTO.TopicCategory, }; topics.Add(topic); } if (topic.Measures.Count >= 2) { continue; } if (topicDTO.TopicCategory == infectionTopicCategoryId) { var num = topicDTO.MeasureValue.AsNullableDouble(); if (num != null && num.HasValue) { topicDTO.MeasureValue = num.Value.ToString("F1"); } } topic.Measures.Add(new InfographicMeasure() { Name = topicDTO.MeasureName, Values = new List <String>() { String.Format("{0}", QualityReportPostProcessLogic.FormatMeasureValue(topicDTO.MeasureName, topicDTO.MeasureValue.ToString())) }, // Values = new List<String>() { String.Format("{0}",topicDTO.MeasureValue.ToString()) } }); } } return(topics); }