|
|
@@ -508,7 +508,7 @@ namespace parkMonitor.DBLocation
|
|
|
int parkingSpaceID = reader.GetInt32("parkingSpaceID");
|
|
|
//float parkingSpaceWeight = reader.GetFloat("parkingSpaceWeight");
|
|
|
//int parkingSpaceStatement = reader.GetInt32("parkingSpaceState");
|
|
|
- int garageID = reader.GetInt32("garageID");
|
|
|
+ //int garageID = reader.GetInt32("garageID");
|
|
|
int parkingSpaceX = reader.GetInt32("parkingSpaceX");
|
|
|
int parkingSpaceY = reader.GetInt32("parkingSpaceY");
|
|
|
int parkingSpaceZ = reader.GetInt32("parkingSpaceZ");
|
|
|
@@ -594,5 +594,51 @@ namespace parkMonitor.DBLocation
|
|
|
return v;
|
|
|
}
|
|
|
|
|
|
+ //根据车位id获得x,y,z
|
|
|
+ public Fetching_Space GetFetchingSpace(int parkingSpaceID)
|
|
|
+ {
|
|
|
+ Fetching_Space fs = new Fetching_Space();
|
|
|
+ MySqlDataReader reader = null;
|
|
|
+ string sql = "select * from parkingspace where parkingSpaceID = '" + parkingSpaceID + " '";
|
|
|
+ con = oper.getConn();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ con.Open();
|
|
|
+ cmd = oper.getComm(sql, con);
|
|
|
+ reader = oper.getResultSet(cmd);
|
|
|
+ while (reader.Read())
|
|
|
+ {
|
|
|
+ if (reader.HasRows)
|
|
|
+ {
|
|
|
+ int parkingSpaceX = reader.GetInt32("parkingSpaceX");
|
|
|
+ int parkingSpaceY = reader.GetInt32("parkingSpaceY");
|
|
|
+ int parkingSpaceZ = reader.GetInt32("parkingSpaceZ");
|
|
|
+ fs.parkingSpaceX = parkingSpaceX;
|
|
|
+ fs.parkingSpaceY = parkingSpaceY;
|
|
|
+ fs.parkingSpaceZ = parkingSpaceZ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (reader != null)
|
|
|
+ {
|
|
|
+ reader.Close();
|
|
|
+ reader.Dispose();
|
|
|
+ }
|
|
|
+ if (cmd != null)
|
|
|
+ {
|
|
|
+ cmd.Dispose();
|
|
|
+ }
|
|
|
+ if (con != null)
|
|
|
+ {
|
|
|
+ con.Close();
|
|
|
+ con.Dispose();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Console.WriteLine(ex.ToString());
|
|
|
+ }
|
|
|
+ return fs;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|