public void DataRefresh() { string jsonText = File.ReadAllText("TouristStatistics.json"); TouristData touristData = JsonConvert.DeserializeObject <TouristData>(jsonText); lblTouristStatistics.Text = $"Total Tourist: {touristData.Total}\n" + $"Current Tourist: {touristData.Current}\n"; dgv.DataSource = touristData.ThemeParkTourist.OrderByDescending(x => Convert.ToInt32(x.NumberOfTourist)).ToList(); }
public void DataRefresh() { string jsonText = File.ReadAllText("TouristStatistics.json"); touristData = JsonConvert.DeserializeObject <TouristData>(jsonText); txtTotal.Text = touristData.Total; txtCurrent.Text = touristData.Current; cboThemePark.DataSource = touristData.ThemeParkTourist; cboThemePark.DisplayMember = "ThemePark"; }