From 1a4d45aed479c8d69ae996dbcf4840f90aa8f3fe Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 04:30:09 +0100
Subject: [PATCH 01/23] add: parent menu
---
.../ParentMenuController.java | 78 ++++++++++++++++++
.../bib/essensbestellungsverwaltung/menue.css | 30 ++-----
.../parentMenu.fxml | 81 +++++++++++++++++++
3 files changed, 166 insertions(+), 23 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
create mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
new file mode 100644
index 0000000..f42f378
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
@@ -0,0 +1,78 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.control.Button;
+import javafx.scene.input.ContextMenuEvent;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.Background;
+import javafx.scene.layout.BorderPane;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+public class ParentMenuController {
+
+ @FXML
+ BorderPane contentView;
+ @FXML
+ Button essensplanButton;
+ @FXML
+ Button kinderButton;
+ @FXML
+ Button bestellungButton;
+ @FXML
+ Button einstellungenButton;
+
+ @FXML
+ public void initialize() {
+ changePage("menue-view.fxml");
+ setButtonActive(essensplanButton);
+ }
+
+
+ @FXML
+ public void onEssensplanClick(MouseEvent mouseEvent) {
+ setButtonActive(essensplanButton);
+ changePage("menue-view.fxml");
+ }
+
+ @FXML
+ public void onKinderClick(MouseEvent mouseEvent) {
+ setButtonActive(kinderButton);
+ changePage("child-view.fxml");
+ }
+
+ @FXML
+ public void onBestellungClick(MouseEvent mouseEvent) {
+ setButtonActive(bestellungButton);
+ changePage("dailyOrder-view.fxml");
+ }
+
+ @FXML
+ public void onEinstellungenClick(MouseEvent mouseEvent) {
+ setButtonActive(einstellungenButton);
+ changePage("menue-view.fxml");
+ }
+
+ @FXML
+ public void onAusloggenClick(MouseEvent mouseEvent) {
+ }
+
+ private void changePage(String page) {
+ try {
+ Parent root = FXMLLoader.load(getClass().getResource(page));
+ contentView.setCenter(root);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ private void setButtonActive(Button b){
+ einstellungenButton.getStyleClass().remove("active");
+ kinderButton.getStyleClass().remove("active");
+ bestellungButton.getStyleClass().remove("active");
+ essensplanButton.getStyleClass().remove("active");
+ b.getStyleClass().add("active");
+ }
+}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
index 1ed99ac..8ea9a07 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
@@ -1,25 +1,9 @@
-#btFoodChoice{
- -fx-background-color: transparent;
-
+.sidebar-nav_button {
+ -fx-background-color: #69b6ff;
+ -fx-text-fill: #123;
+ -fx-border-color: #000;
+ -fx-border-radius: 20;
}
-
-#btFoodChoice:hover{
- -fx-underline: true;
- -fx-text-fill: black;
-}
-#btPlaceOrder{
- -fx-background-color: lightblue;
- -fx-text-fill: white;
- -fx-background-radius: 25;
-}
-
-
-#btPlaceOrder:hover{
- -fx-border-width: 0;
- -fx-text-fill: black;
- -fx-underline: true;
-}
-
-#cbChooseChild{
- -fx-background-color: lightgray;
+.sidebar-nav_button.active {
+ -fx-background-color: #4e92b4;
}
\ No newline at end of file
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
new file mode 100644
index 0000000..40a5e8b
--- /dev/null
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 2b5839f0eaf638b5329d85f8a42a525260c7c249 Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 04:30:25 +0100
Subject: [PATCH 02/23] add: workerMenu
---
.../WorkerMenuController.java | 93 +++++++++++++++
.../workerMenu.fxml | 111 ++++++++++++++++++
2 files changed, 204 insertions(+)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
create mode 100644 src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
new file mode 100644
index 0000000..5d5ddcd
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
@@ -0,0 +1,93 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Parent;
+import javafx.scene.control.Button;
+import javafx.scene.input.ContextMenuEvent;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.layout.BorderPane;
+
+import java.io.IOException;
+
+public class WorkerMenuController {
+ @FXML
+ public BorderPane contentView;
+
+ @FXML
+ Button tagesbestellungButton;
+ @FXML
+ Button wochenplanButton;
+ @FXML
+ Button monatsabrechnungButton;
+ @FXML
+ Button mitarbeiterButton;
+ @FXML
+ Button mahlzeitButton;
+ @FXML
+ Button einstellungenButton;
+
+ @FXML
+ public void initialize() {
+ changePage("menue-view.fxml");
+ setButtonActive(tagesbestellungButton);
+ }
+
+ @FXML
+ public void onTagesbestellungenClick(MouseEvent mouseEvent) {
+ changePage("menue-view.fxml");
+ setButtonActive(tagesbestellungButton);
+ }
+
+ @FXML
+ public void onWochenplanClick(MouseEvent mouseEvent) {
+ setButtonActive(wochenplanButton);
+ }
+
+ @FXML
+ public void onMonatsabrechnungClick(MouseEvent mouseEvent) {
+ changePage("invoice-view.fxml");
+ setButtonActive(monatsabrechnungButton);
+ }
+
+
+ @FXML
+ public void onMitarbeiterClick(MouseEvent mouseEvent) {
+ changePage("createCoworker-view.fxml");
+ setButtonActive(mitarbeiterButton);
+ }
+
+
+ @FXML
+ public void onMahlzeitClick(MouseEvent mouseEvent) {
+ setButtonActive(mahlzeitButton);
+ }
+
+
+ public void onEinstellungenClick(MouseEvent mouseEvent) {
+ setButtonActive(einstellungenButton);
+ }
+
+ @FXML
+ public void onAusloggenClick(MouseEvent mouseEvent) {
+ }
+
+ private void changePage(String page) {
+ try {
+ Parent root = FXMLLoader.load(getClass().getResource(page));
+ contentView.setCenter(root);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private void setButtonActive(Button b) {
+ tagesbestellungButton.getStyleClass().remove("active");
+ monatsabrechnungButton.getStyleClass().remove("active");
+ wochenplanButton.getStyleClass().remove("active");
+ mahlzeitButton.getStyleClass().remove("active");
+ mitarbeiterButton.getStyleClass().remove("active");
+ einstellungenButton.getStyleClass().remove("active");
+ b.getStyleClass().add("active");
+ }
+}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
new file mode 100644
index 0000000..92368ad
--- /dev/null
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/workerMenu.fxml
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From c981fbca197e59367f410b5373631ffa78404444 Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 06:01:53 +0100
Subject: [PATCH 03/23] add: Rechnung View
---
.../InvoiceController.java | 67 +++++++++++++++++++
.../ParentMenuController.java | 6 +-
.../StartViewApplication.java | 4 +-
.../WorkerMenuController.java | 6 +-
.../invoice-view.fxml | 66 +++++++++++++++---
5 files changed, 137 insertions(+), 12 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java b/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
new file mode 100644
index 0000000..aebd7ba
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/InvoiceController.java
@@ -0,0 +1,67 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.fxml.FXML;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Spinner;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.text.Text;
+
+import java.util.Calendar;
+
+public class InvoiceController {
+ @FXML
+ Text responseText;
+ @FXML
+ ChoiceBox monatChoiceBox;
+
+ @FXML
+ Spinner jahrSpinner;
+
+ @FXML
+ public void initialize() {
+ monatChoiceBox.setValue(intToMonth(Calendar.getInstance().get(Calendar.MONTH) + 1));
+ jahrSpinner.getValueFactory().setValue(Calendar.getInstance().get(Calendar.YEAR));
+ }
+
+ @FXML
+ void onRechnungErstellenClick(MouseEvent mouseEvent) {
+ responseText.setText(monatChoiceBox.getValue().toString() + jahrSpinner.getValue());
+ // hier rechnung erstellen
+ }
+
+ private int monthToInt(String month) {
+ return switch (month) {
+ case "Januar" -> 1;
+ case "Februar" -> 2;
+ case "März" -> 3;
+ case "April" -> 4;
+ case "Mai" -> 5;
+ case "Juni" -> 6;
+ case "Juli" -> 7;
+ case "August" -> 8;
+ case "September" -> 9;
+ case "Oktober" -> 10;
+ case "November" -> 11;
+ case "Dezember" -> 12;
+ default -> -1;
+ };
+ }
+
+ private String intToMonth(int month) {
+ return switch (month) {
+ case 1 -> "Januar";
+ case 2 -> "Februar";
+ case 3 -> "März";
+ case 4 -> "April";
+ case 5 -> "Mai";
+ case 6 -> "Juni";
+ case 7 -> "Juli";
+ case 8 -> "August";
+ case 9 -> "September";
+ case 10 -> "Oktober";
+ case 11 -> "November";
+ case 12 -> "Dezember";
+ default -> "";
+ };
+ }
+}
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
index f42f378..a50d7ae 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/ParentMenuController.java
@@ -3,11 +3,13 @@ package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
+import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Background;
import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
import java.io.IOException;
import java.util.Arrays;
@@ -57,7 +59,9 @@ public class ParentMenuController {
}
@FXML
- public void onAusloggenClick(MouseEvent mouseEvent) {
+ public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
+ Parent p = FXMLLoader.load(StartViewApplication.class.getResource("workerMenu.fxml"));
+ StartViewApplication.primary.getScene().setRoot(p);
}
private void changePage(String page) {
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
index fe03394..8e64c57 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
@@ -17,8 +17,8 @@ public class StartViewApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load(), 950,480);
- //stage = primary;
+ Scene scene = new Scene(fxmlLoader.load(), 1200,900);
+ primary = stage;
stage.setTitle("Essen Bestellung im Kindergarten");
stage.setScene(scene);
stage.show();
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
index 5d5ddcd..d552aea 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/WorkerMenuController.java
@@ -3,10 +3,12 @@ package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
+import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.ContextMenuEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
+import javafx.stage.Stage;
import java.io.IOException;
@@ -69,7 +71,9 @@ public class WorkerMenuController {
}
@FXML
- public void onAusloggenClick(MouseEvent mouseEvent) {
+ public void onAusloggenClick(MouseEvent mouseEvent) throws IOException {
+ Parent p = FXMLLoader.load(StartViewApplication.class.getResource("parentMenu.fxml"));
+ StartViewApplication.primary.getScene().setRoot(p);
}
private void changePage(String page) {
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
index 1087a44..399a6bd 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
@@ -1,14 +1,64 @@
-
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From c890819be7caeb497dae49c5f37d7dc171dac18d Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Tue, 31 Jan 2023 07:03:11 +0100
Subject: [PATCH 04/23] fix: changed window size
---
.../StartViewApplication.java | 2 +-
.../invoice-view.fxml | 2 +-
.../menue-view.fxml | 22 ++++++++-----------
.../parentMenu.fxml | 6 ++---
.../workerMenu.fxml | 6 ++---
5 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
index 8e64c57..1d7a126 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/StartViewApplication.java
@@ -17,7 +17,7 @@ public class StartViewApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
- Scene scene = new Scene(fxmlLoader.load(), 1200,900);
+ Scene scene = new Scene(fxmlLoader.load(), 1200,750);
primary = stage;
stage.setTitle("Essen Bestellung im Kindergarten");
stage.setScene(scene);
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
index 399a6bd..5b2a05c 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/invoice-view.fxml
@@ -7,7 +7,7 @@
-
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
index 43deb3c..fae1559 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
@@ -1,17 +1,13 @@
-
-
-
-
-
-
-
-
+
+
+
+
-
+
-
+
@@ -315,9 +311,9 @@
-
-
-
+
+
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
index 40a5e8b..96aff03 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/parentMenu.fxml
@@ -6,9 +6,9 @@
-
+
-
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 72c2e9da16fb118156634624fbe786e29b94cc48 Mon Sep 17 00:00:00 2001
From: richard
Date: Tue, 31 Jan 2023 15:38:08 +0100
Subject: [PATCH 08/23] =?UTF-8?q?Childview=20&=20Elternmenue=20hinzugef?=
=?UTF-8?q?=C3=BCgt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MenueController.java | 7 +-
.../child-view.fxml | 149 ++------
.../menue-view.fxml | 325 +++++++-----------
.../bib/essensbestellungsverwaltung/menue.css | 3 +-
4 files changed, 161 insertions(+), 323 deletions(-)
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java
index c52b33a..aaa7f7a 100644
--- a/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/MenueController.java
@@ -17,9 +17,8 @@ import java.io.IOException;
public class MenueController {
- @FXML
- private void onBtLoginClick(){
- Alert alert = new Alert(Alert.AlertType.ERROR, "Hi");
- alert.showAndWait();
+
+ private void setButtonActive(){
+
}
}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/child-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/child-view.fxml
index 3e15a09..dab0830 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/child-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/child-view.fxml
@@ -2,6 +2,8 @@
+
+
@@ -10,16 +12,42 @@
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,115 +65,11 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -158,7 +82,7 @@
-
+
@@ -171,7 +95,6 @@
-
-
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
index fae1559..1ad226e 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue-view.fxml
@@ -1,322 +1,237 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
+
+
-
+
-
+
-
+
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
-
+
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
-
+
-
+
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
-
+
-
+
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
-
+
-
+
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
index 8ea9a07..0dcdd16 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/menue.css
@@ -6,4 +6,5 @@
}
.sidebar-nav_button.active {
-fx-background-color: #4e92b4;
-}
\ No newline at end of file
+}
+
From 5ee0288736dc1bd5a33ee4d2fd5b210c9df1049f Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Wed, 1 Feb 2023 07:21:37 +0100
Subject: [PATCH 09/23] add: database.db to gitignore
---
.gitignore | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 5ff6309..1165112 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,4 +35,6 @@ build/
.vscode/
### Mac OS ###
-.DS_Store
\ No newline at end of file
+.DS_Store
+
+/database.db
\ No newline at end of file
From f71aba35055e7206f941598ec98a43f5b55faa73 Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Wed, 1 Feb 2023 07:21:59 +0100
Subject: [PATCH 10/23] add: createFood
---
.../CreateFoodController.java | 71 +++++++
.../createFood-view.fxml | 195 +++++++++---------
2 files changed, 171 insertions(+), 95 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodController.java
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodController.java b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodController.java
new file mode 100644
index 0000000..7370fdf
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodController.java
@@ -0,0 +1,71 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.scene.control.RadioButton;
+import javafx.scene.control.TextArea;
+import javafx.scene.control.TextField;
+import javafx.scene.text.Text;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class CreateFoodController {
+ @FXML
+ public TextField name;
+ @FXML
+ public TextArea description;
+ @FXML
+ public RadioButton isHauptgerichtRadio;
+ @FXML
+ public RadioButton isDessertRadio;
+ @FXML
+ public RadioButton isVegetarischRadio;
+ @FXML
+ public RadioButton isVeganRadio;
+ @FXML
+ public RadioButton isFleischRadio;
+ @FXML
+ public TextArea allergienTextBox;
+ @FXML
+ public Text responseText;
+
+ @FXML
+ public void onAbbrechen(ActionEvent actionEvent) {
+ clearInputs();
+ }
+
+ @FXML
+ public void onHinzufügen(ActionEvent actionEvent) {
+ String gerichtName = name.getText();
+ String beschreibung = description.getText();
+ if(!isHauptgerichtRadio.isSelected() && !isDessertRadio.isSelected()){
+ // art auswähelen
+ }
+ boolean isNachtisch = !isHauptgerichtRadio.isSelected();
+ if(!isVegetarischRadio.isSelected() && !isVeganRadio.isSelected() && isFleischRadio.isSelected()){
+ // Typ auswählen
+ }
+ int ft = isVeganRadio.isSelected() ? 1 : isVeganRadio.isSelected() ? 2 : 3;
+ FoodType foodType = new FoodType(ft, "Vegan");
+ List allergies = new ArrayList<>();
+ // TODO: allergien hinzufügen
+
+ long id = FoodMgr.createFood(new Food(gerichtName, beschreibung, isNachtisch, foodType, allergies));
+ System.out.println("Food created with id: " + id);
+ responseText.setText("New Food Created");
+ clearInputs();
+ }
+
+ private void clearInputs(){
+ name.setText("");
+ description.setText("");
+ isHauptgerichtRadio.setSelected(false);
+ isDessertRadio.setSelected(false);
+ isVeganRadio.setSelected(false);
+ isVegetarischRadio.setSelected(false);
+ isFleischRadio.setSelected(false);
+ allergienTextBox.setText("");
+ }
+}
diff --git a/src/main/resources/com/bib/essensbestellungsverwaltung/createFood-view.fxml b/src/main/resources/com/bib/essensbestellungsverwaltung/createFood-view.fxml
index 018c80d..1e81cbf 100644
--- a/src/main/resources/com/bib/essensbestellungsverwaltung/createFood-view.fxml
+++ b/src/main/resources/com/bib/essensbestellungsverwaltung/createFood-view.fxml
@@ -1,102 +1,107 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
From 324ce53bd42e05350d235201ac793e48dfbcefcb Mon Sep 17 00:00:00 2001
From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com>
Date: Wed, 1 Feb 2023 07:22:09 +0100
Subject: [PATCH 11/23] add: createFoodplan
---
.../CreateFoodplanController.java | 120 +++++++++++++
.../essensbestellungsverwaltung/FoodMgr.java | 17 ++
.../createFoodplan-view.fxml | 164 +++++++++---------
3 files changed, 217 insertions(+), 84 deletions(-)
create mode 100644 src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java
diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java
new file mode 100644
index 0000000..b0f31d1
--- /dev/null
+++ b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java
@@ -0,0 +1,120 @@
+package com.bib.essensbestellungsverwaltung;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Button;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.DatePicker;
+
+import java.time.LocalDate;
+import java.util.List;
+
+public class CreateFoodplanController {
+ @FXML
+ Button erstellenButton;
+ @FXML
+ DatePicker date;
+
+ @FXML
+ ChoiceBox firstMeal;
+
+ @FXML
+ ChoiceBox secondMeal;
+
+ @FXML
+ ChoiceBox firstDessert;
+
+ @FXML
+ ChoiceBox secondDessert;
+
+ private List foods;
+ private List desserts;
+ private FoodPlan currentPlan;
+
+
+ @FXML
+ public void initialize() {
+ foods = FoodMgr.getFood(false);
+ desserts = FoodMgr.getFood(true);
+ ObservableList