public ActionResult GetEuroStatTable(TableFormData data) { int curLang = Language.Id; var stats = GdpPerCapitaDataRow.GetGdpPerCapitaDataRows(new DateTime(2010, 1, 1), new DateTime(2017, 1, 1), curLang).ToList(); var tableData = new TableDataEurostat() { Data = new List <Dictionary <string, string> >() }; int cnt = 0; foreach (var stat in stats) { cnt++; var row = new Dictionary <string, string> { { "id", cnt.ToString() } }; row.Add("country", stat.Country); foreach (var value in stat.HicpValues) { row.Add(value.TimePeriod.Trim(), value.TableValue); } tableData.Data.Add(row); } tableData.Draw = data.Draw; tableData.RecordsTotal = tableData.Data.Count(); tableData.RecordsFiltered = tableData.Data.Count(); return(CamelCaseJson(tableData, JsonRequestBehavior.AllowGet)); }
public ActionResult EuroStat() { if (!this.ValidateHasEuroFins()) { return(PartialView("~/Views/Error/_UnavaiableProductEuroFins.cshtml")); } int curLang = Language.Id; var euroStat = new Eurostat() { LastExtraction = GdpPerCapitaDataRow.GetLastExtraction(), // euroStat.StatisticName = Resources.Resources.UI_fins_eurostat_HICP; StatisticName = Resources.Resources.UI_EuroStat }; euroStat.Tables.Add(new EuroStatTable() { Stats = GdpPerCapitaDataRow.GetGdpPerCapitaDataRows(new DateTime(2010, 1, 1), new DateTime(2017, 1, 1), curLang).ToList(), TableName = Resources.Resources.UI_fins_eurostat_HICP_PchMV12 }); ViewBag.Page = "GDPCapitalPPS"; return(PartialView("~/Views/Finances/_EuroStat.cshtml", euroStat)); }