// Hier werden die Datensätze in die Datenbank Eingefügt für die Tabelle Parkplatz. // Die einzufügenden Werte werden als Parameter gegeben. void addParkPlatz(Parkplatz park) { IDbConnection _connection = new SqliteConnection(_strDBName); IDbCommand _command = _connection .CreateCommand(); string sql; _connection .Open(); sql = "INSERT INTO PARKPLATZ (PARKPLATZNUMMER, ROUTENID, FREI, KENNZEICHENFAHRZEUG, XKOORD, ZKOORD) Values ("+park.getPARKPLATZNUMMER()+","+park.getROUTENID()+", 1,0,"+park.getX()+","+park.getZ()+")"; _command.CommandText = sql; _command.ExecuteReader(); _command.Dispose (); _command = null; _connection.Close (); _connection.Dispose (); _connection = null; }
// Hier wird ein gegebenes Parkplatz mit einem Gegebenen Auto Besetzt public void setStatusbesetztParkplatz(String Kennzeichen,Parkplatz pk) { IDbConnection _connection = new SqliteConnection(_strDBName); IDbCommand _command = _connection .CreateCommand(); string sql; //Debug.Log ("Parkplatznummer in setStatusbesetztParkplatz " + pk.getPARKPLATZNUMMER ()+ " Kennzeichen " + Kennzeichen); _connection .Open(); sql = "UPDATE PARKPLATZ SET FREI = '0', KENNZEICHENFAHRZEUG = '"+Kennzeichen+"' WHERE PARKPLATZNUMMER = "+pk.getPARKPLATZNUMMER(); _command.CommandText = sql; _command.ExecuteNonQuery(); _command.Dispose(); _command = null; _connection .Close(); _connection.Dispose (); _connection = null; }