diff --git a/src/application/Job.java b/src/application/Job.java index bfabb98..e31512e 100644 --- a/src/application/Job.java +++ b/src/application/Job.java @@ -24,9 +24,6 @@ public class Job this.jobnumber = pJobnumber; this.jobtime = pTime; - System.out - .println("Neuer Job: " + this.jobnumber + " Time: " + this.jobtime); - positionenQuantity = new ArrayList(); positionenName = new ArrayList(); positionenValue = new ArrayList(); @@ -49,6 +46,8 @@ public class Job public float getJobValue() { + calcJobValue(); + return this.jobvalue; } @@ -120,6 +119,8 @@ public class Job private void calcJobValue() { + jobvalue = 0; + for (int i = 0; i < positionenValue.size(); i++) { jobvalue = jobvalue @@ -131,42 +132,77 @@ public class Job public String createPosQuantityDBString() { - String tmp = ""; - for (int i = 0; i < positionenName.size(); i++) { + String tmp = String.valueOf(positionenQuantity.get(0)); + for (int i = 1; i < positionenName.size(); i++) { tmp = tmp + ";" + positionenQuantity.get(i); } return tmp; } - + public String createPosNameDBString() { - String tmp = ""; - for (int i = 0; i < positionenName.size(); i++) { + String tmp = positionenName.get(0); + for (int i = 1; i < positionenName.size(); i++) { tmp = tmp + ";" + positionenName.get(i); } return tmp; } - + public String createPosValueDBString() { - String tmp = ""; - for (int i = 0; i < positionenName.size(); i++) { + String tmp = String.valueOf(positionenValue.get(0)); + for (int i = 1; i < positionenName.size(); i++) { tmp = tmp + ";" + positionenValue.get(i); } return tmp; } - + public String createPosCatDBString() { - String tmp = ""; - for (int i = 0; i < positionenName.size(); i++) { + String tmp = positionenCat.get(0); + for (int i = 1; i < positionenName.size(); i++) { tmp = tmp + ";" + positionenCat.get(i); } return tmp; } + public void deletePosName(String pPosName) + { + + for (int i = 0; i < positionenName.size(); i++) { + + if (positionenName.get(i).equals(pPosName)) { + + if (positionenQuantity.get(i) > 1) { + positionenQuantity.set(i, positionenQuantity.get(i) - 1); + } else { + + positionenQuantity.remove(i); + positionenName.remove(i); + positionenValue.remove(i); + positionenCat.remove(i); + + } + + } + + } + + } + + public boolean existsPosName(String pPosName) + { + for (int i = 0; i < positionenName.size(); i++) { + if (positionenName.get(i).equals(pPosName)) { + return true; + } + } + + return false; + } + } diff --git a/src/application/MainWindow.fxml b/src/application/MainWindow.fxml index 091ab43..f28b3e8 100644 --- a/src/application/MainWindow.fxml +++ b/src/application/MainWindow.fxml @@ -108,7 +108,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -186,6 +186,9 @@ + + @@ -241,10 +244,16 @@ + + - - + + + + + @@ -401,7 +410,7 @@