From 6344eaed34399a98a25ebddcd0569ad25380a58b Mon Sep 17 00:00:00 2001 From: Le Chau Date: Thu, 25 Jun 2020 11:11:20 +0700 Subject: [PATCH] =?UTF-8?q?Refactor:=20=C4=90=E1=BB=95i=20t=C3=AAn=20class?= =?UTF-8?q?=20{Vehicle}=20->=20{parkInfo}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIParkingApplication/Statistic.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AIParkingApplication/Statistic.cs b/AIParkingApplication/Statistic.cs index 818fd3b..493b0ba 100644 --- a/AIParkingApplication/Statistic.cs +++ b/AIParkingApplication/Statistic.cs @@ -43,26 +43,26 @@ namespace AIParkingApplication { HttpResponseMessage response = await client.GetAsync("/api/statistics"); response.EnsureSuccessStatusCode(); - var vehicle = await response.Content.ReadAsAsync(); - if(vehicle == null) + var parkInfo = await response.Content.ReadAsAsync(); + if(parkInfo == null) { return; } lblSoLuongXeMay.Invoke(new Action(() => { - lblSoLuongXeMay.Text = vehicle.NumberOfMoto.ToString(); + lblSoLuongXeMay.Text = parkInfo.NumberOfMoto.ToString(); })); lblSoLuongOto.Invoke(new Action(() => { - lblSoLuongOto.Text = vehicle.NumberOfCar.ToString(); + lblSoLuongOto.Text = parkInfo.NumberOfCar.ToString(); })); lblVehicleTotalIn.Invoke(new Action(() => { - lblVehicleTotalIn.Text = vehicle.TotalIn; + lblVehicleTotalIn.Text = parkInfo.TotalIn; })); lblVehicleTotalOut.Invoke(new Action(() => { - lblVehicleTotalOut.Text = vehicle.TotalOut; + lblVehicleTotalOut.Text = parkInfo.TotalOut; })); } @@ -94,7 +94,7 @@ namespace AIParkingApplication tlpStatisticTable.Controls.Add(lblSoLuongOto, 1, 2); } - public class Vehicle + public class ParkInfo { [JsonProperty("oto")] public int NumberOfCar { get; set; }