/// <summary> /// Initializes the sales data. /// </summary> private void InitializeSalesData() { DateTime now = DateTime.Now; for (int month = 1; month <= 12; month++) { var monthDate = new DateTime(now.Year, month, 1); SalesData.Add(new MonthlySalesData(GetRandomSalesValue(), monthDate)); } this.SalesData2 = new TimeAggregatedDataGenerator(new double[] { 10.5, 19.5, 14.3, 4.8, 8.4, -1.3, 7.7, 1.8, -1.8, -9.4, -9.7, -6.2, 2.0, 11.2, 18.6, 27.4, 18.7, 11.3, 9.2 }); this.SalesData3 = new TimeAggregatedDataGenerator(new double[] { -1800, -6200, 11300, 9200, 9500, 18500, 14300, 4800, 8400, -1300, 9700, 4000, 10200, 19000, 12000, 11000, 9000, 100, 1800 }); }
/// <summary> /// Method to get Sales Data for Last Year based upon the CountryRegion code /// </summary> public async void GetLastYearSalesDataByCountryRegion() { if (CountryRegionName != null) { SalesData.Clear(); var res = (from sale in await adapter.GetSalesInformation() where sale.CountryRegionCode == CountryRegionName.CountryRegion select new { sale.Name, sale.SalesLastYear }).ToList(); foreach (var item in res) { SalesData.Add(new SalesInfo() { Name = item.Name, Sales = item.SalesLastYear }); } } }