public async Task GetChapterData(int countyId, int countyId2, string chapter)
        {
            if (!ChapterList.ContainsKey(chapter) || countyId < 1)
            {
                return;
            }

            ValueColumnCaption = string.Format("{0} {1}", UnitOfMeasureList[chapter], CountyAbbreviations[CountyList.First(x => x.Value == countyId).Key]);

            var data = await CountyDetailsProvider.GetData(countyId, ChapterList[chapter]);

            HasData = data.Count > 0;

            if (countyId2 >= 1 && countyId != countyId2)
            {
                var data2 = await CountyDetailsProvider.GetData(countyId2, ChapterList[chapter]);

                foreach (var item2 in data2)
                {
                    var item = data.FirstOrDefault(x => x.Year == item2.Year && x.YearFraction == item2.YearFraction);
                    if (item != null)
                    {
                        item.Value2 = item2.Value;
                    }
                }

                Value2ColumnCaption = string.Format("{0} {1}", UnitOfMeasureList[chapter], CountyAbbreviations[CountyList.First(x => x.Value == countyId2).Key]);

                Value2ColumnVisibility = true;
            }
            else
            {
                Value2ColumnVisibility = false;
            }

            ChapterData.Clear();
            ChapterDataReversed.Clear();

            foreach (var item in data)
            {
                ChapterData.Add(item);
                ChapterDataReversed.Insert(0, item);
            }
        }
Example #2
0
        public async Task GetChapterData(int countyId, string chapter)
        {
            ValueColumnCaption = "Lei";

            ChapterData.Clear();
            ChapterDataReversed.Clear();

            if (!ChapterList.ContainsKey(chapter) || countyId < 1)
            {
                return;
            }

            var data = await CountyDetailsProvider.GetData(countyId, ChapterList[chapter]);

            foreach (var item in data)
            {
                ChapterData.Add(item);
                ChapterDataReversed.Insert(0, item);
            }
        }