public JsonResult GetReports(string pRegion = null) { string parameter = string.Empty; var Reports = new List <Data>(); Reports = new CovidBL().GetReports(pRegion, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); Reports = Reports.OrderByDescending(x => x.Confirmed).Take(10).ToList(); return(Json(Reports, JsonRequestBehavior.AllowGet)); }
public ActionResult ToXML(string pRegion = null) { string parameter = string.Empty; var Reports = new List <Data>(); IOTools iO = new IOTools(); Reports = new CovidBL().GetReports(pRegion, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty); Reports = Reports.OrderByDescending(x => x.Confirmed).Take(10).ToList(); var data = iO.CreateXML(Reports); byte[] bytes = System.Text.Encoding.UTF8.GetBytes(data); var output = new FileContentResult(bytes, "application/octet-stream"); output.FileDownloadName = "CovidCases.xml"; return(output); }
public JsonResult GetRegions() { var Regions = new CovidBL().GetRegions(); return(Json(Regions, JsonRequestBehavior.AllowGet)); }