Refactor: Đổi tên class {Vehicle} -> {parkInfo}
This commit is contained in:
parent
e939613153
commit
6344eaed34
|
@ -43,26 +43,26 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
HttpResponseMessage response = await client.GetAsync("/api/statistics");
|
HttpResponseMessage response = await client.GetAsync("/api/statistics");
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
var vehicle = await response.Content.ReadAsAsync<Vehicle>();
|
var parkInfo = await response.Content.ReadAsAsync<ParkInfo>();
|
||||||
if(vehicle == null)
|
if(parkInfo == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lblSoLuongXeMay.Invoke(new Action(() =>
|
lblSoLuongXeMay.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
lblSoLuongXeMay.Text = vehicle.NumberOfMoto.ToString();
|
lblSoLuongXeMay.Text = parkInfo.NumberOfMoto.ToString();
|
||||||
}));
|
}));
|
||||||
lblSoLuongOto.Invoke(new Action(() =>
|
lblSoLuongOto.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
lblSoLuongOto.Text = vehicle.NumberOfCar.ToString();
|
lblSoLuongOto.Text = parkInfo.NumberOfCar.ToString();
|
||||||
}));
|
}));
|
||||||
lblVehicleTotalIn.Invoke(new Action(() =>
|
lblVehicleTotalIn.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
lblVehicleTotalIn.Text = vehicle.TotalIn;
|
lblVehicleTotalIn.Text = parkInfo.TotalIn;
|
||||||
}));
|
}));
|
||||||
lblVehicleTotalOut.Invoke(new Action(() =>
|
lblVehicleTotalOut.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
lblVehicleTotalOut.Text = vehicle.TotalOut;
|
lblVehicleTotalOut.Text = parkInfo.TotalOut;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ namespace AIParkingApplication
|
||||||
tlpStatisticTable.Controls.Add(lblSoLuongOto, 1, 2);
|
tlpStatisticTable.Controls.Add(lblSoLuongOto, 1, 2);
|
||||||
|
|
||||||
}
|
}
|
||||||
public class Vehicle
|
public class ParkInfo
|
||||||
{
|
{
|
||||||
[JsonProperty("oto")]
|
[JsonProperty("oto")]
|
||||||
public int NumberOfCar { get; set; }
|
public int NumberOfCar { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user