|
@@ -30,7 +30,7 @@ namespace parkMonitor.DataBase
|
|
|
return garageFreeSpace;
|
|
|
}
|
|
|
|
|
|
- //查询车位位置及状态,返回list
|
|
|
+ //查询空闲车位位置
|
|
|
public Dictionary<int, Parking_Space> GetParkingSpace(string connectionStr, int garageID)
|
|
|
{
|
|
|
Dictionary<int, Parking_Space> lps = new Dictionary<int, Parking_Space>();
|
|
@@ -60,6 +60,37 @@ namespace parkMonitor.DataBase
|
|
|
return lps;
|
|
|
}
|
|
|
|
|
|
+ //查询所有车位位置及状态
|
|
|
+ public Dictionary<int, Parking_Space> GetAllParkingSpace(string connectionStr, int garageID)
|
|
|
+ {
|
|
|
+ Dictionary<int, Parking_Space> lps = new Dictionary<int, Parking_Space>();
|
|
|
+ MySqlDataReader reader = null;
|
|
|
+ string sql = "select * from parkingspace where garageID = '" + garageID + "' ";
|
|
|
+ Operation oper = new Operation(connectionStr, sql);
|
|
|
+ int count = 0;
|
|
|
+ reader = oper.getResultSet(ref count);
|
|
|
+ if (count > 0 && reader.Read())
|
|
|
+ {
|
|
|
+ for (int i = 1; i <= count; i++)
|
|
|
+ {
|
|
|
+ Parking_Space ps = new Parking_Space();
|
|
|
+ ps.parkingSpaceID = reader.GetInt32("parkingSpaceID");
|
|
|
+ ps.parkingSpaceX = reader.GetInt32("parkingSpaceX");
|
|
|
+ ps.parkingSpaceY = reader.GetInt32("parkingSpaceY");
|
|
|
+ ps.parkingSpaceZ = reader.GetInt32("parkingSpaceZ");
|
|
|
+ ps.parkingSpaceState = reader.GetInt32("parkingSpaceState");
|
|
|
+ ps.garageID = garageID;
|
|
|
+ lps.Add(i, ps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Console.WriteLine("查无结果");
|
|
|
+ }
|
|
|
+ oper.DBClose();
|
|
|
+ return lps;
|
|
|
+ }
|
|
|
+
|
|
|
//数据插入云记录表,并返回停车记录id
|
|
|
public int InsertToParkingRecords(string connectionStr, int userID, string numberPlate, int parkingSpaceID, int garageID, int parkingRecordsState, string realParkTime)
|
|
|
{
|