Refactor: Đổi tên class {Vehicle} -> {parkInfo}

This commit is contained in:
Le Chau 2020-06-25 11:11:20 +07:00
parent e939613153
commit 6344eaed34

View File

@ -43,26 +43,26 @@ namespace AIParkingApplication
{
HttpResponseMessage response = await client.GetAsync("/api/statistics");
response.EnsureSuccessStatusCode();
var vehicle = await response.Content.ReadAsAsync<Vehicle>();
if(vehicle == null)
var parkInfo = await response.Content.ReadAsAsync<ParkInfo>();
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; }