Reverted Merge Error where changes were deleted
This commit is contained in:
@@ -2053,15 +2053,16 @@ public class Dataset {
|
|||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
System.err.println( e.getClass().getName() + ": " + e.getMessage() );
|
||||||
}
|
}
|
||||||
|
FlightPath flightPath = flightPathDictionary.get(flightPoint.getIndex());
|
||||||
FlightPath flightPath = flightPathDictionary.get(flightPoint.getIndexID());
|
|
||||||
int indexOf = flightPath.getFlightPoints().indexOf(flightPoint);
|
int indexOf = flightPath.getFlightPoints().indexOf(flightPoint);
|
||||||
|
|
||||||
if (indexOf == 0){
|
if (indexOf == 0){
|
||||||
try {
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
stmt = c.createStatement();
|
stmt = c.createStatement();
|
||||||
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Source_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
||||||
"WHERE `Path_ID` = "+flightPoint.getIndexID();
|
"WHERE `Path_ID` = "+flightPoint.getIndex();
|
||||||
stmt.execute(query);
|
stmt.execute(query);
|
||||||
c.close();
|
c.close();
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
@@ -2070,9 +2071,11 @@ public class Dataset {
|
|||||||
flightPath.setDepartureAirport(flightPoint.getName());
|
flightPath.setDepartureAirport(flightPoint.getName());
|
||||||
} else if (indexOf == flightPath.getFlightPoints().size() - 1) {
|
} else if (indexOf == flightPath.getFlightPoints().size() - 1) {
|
||||||
try {
|
try {
|
||||||
|
Class.forName("org.sqlite.JDBC");
|
||||||
|
c = DriverManager.getConnection("jdbc:sqlite:res/userdb.db");
|
||||||
stmt = c.createStatement();
|
stmt = c.createStatement();
|
||||||
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
String query = "UPDATE `"+this.name+"_Flight_Path` SET `Destination_Airport` = \""+flightPoint.getName().replace("\"", "\"\"")+"\" " +
|
||||||
"WHERE `Path_ID` = "+flightPoint.getIndexID();
|
"WHERE `Path_ID` = "+flightPoint.getIndex();
|
||||||
stmt.execute(query);
|
stmt.execute(query);
|
||||||
c.close();
|
c.close();
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user