feat/kindErstellen #9
@ -0,0 +1,39 @@
|
|||||||
|
package com.bib.essensbestellungsverwaltung;
|
||||||
|
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.DatePicker;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DailyOrderController {
|
||||||
|
public ListView listView;
|
||||||
|
public DatePicker datePicker;
|
||||||
|
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void initialize() {
|
||||||
|
datePicker.setValue(LocalDate.now());
|
||||||
|
updatePlan(datePicker.getValue().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onChangeDate(ActionEvent actionEvent) {
|
||||||
|
updatePlan(datePicker.getValue().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void updatePlan(String date){
|
||||||
|
System.out.print("Orders from " + date + " : ");
|
||||||
|
List<String> orders = FoodMgr.getDayOrder(date);
|
||||||
|
|
||||||
|
System.out.println(orders);
|
||||||
|
|
||||||
|
listView.getItems().clear();
|
||||||
|
for(String order : orders){
|
||||||
|
listView.getItems().add(order);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -235,6 +235,9 @@ public class FoodMgr {
|
|||||||
public static List<String> getDayOrder(String date){
|
public static List<String> getDayOrder(String date){
|
||||||
List<String> orders = new ArrayList<>();
|
List<String> orders = new ArrayList<>();
|
||||||
FoodPlan food_plan = getFoodPlan(date);
|
FoodPlan food_plan = getFoodPlan(date);
|
||||||
|
if(food_plan == null){
|
||||||
|
return orders;
|
||||||
|
}
|
||||||
String sId = String.valueOf(food_plan.getId());
|
String sId = String.valueOf(food_plan.getId());
|
||||||
String[] food_selectionH = {"food_planid","foodid"};
|
String[] food_selectionH = {"food_planid","foodid"};
|
||||||
Food[] foodArray = {
|
Food[] foodArray = {
|
||||||
|
@ -27,13 +27,13 @@ public class WorkerMenuController {
|
|||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
changePage("menue-view.fxml");
|
changePage("dailyOrder-view.fxml");
|
||||||
setButtonActive(tagesbestellungButton);
|
setButtonActive(tagesbestellungButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void onTagesbestellungenClick(MouseEvent mouseEvent) {
|
public void onTagesbestellungenClick(MouseEvent mouseEvent) {
|
||||||
changePage("menue-view.fxml");
|
changePage("dailyOrder-view.fxml");
|
||||||
setButtonActive(tagesbestellungButton);
|
setButtonActive(tagesbestellungButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import java.lang.*?>
|
|
||||||
<?import java.util.*?>
|
|
||||||
<?import javafx.scene.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
|
<?import javafx.scene.text.*?>
|
||||||
|
|
||||||
<AnchorPane xmlns="http://javafx.com/javafx"
|
<AnchorPane prefHeight="700.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.bib.essensbestellungsverwaltung.DailyOrderController">
|
||||||
xmlns:fx="http://javafx.com/fxml"
|
<children>
|
||||||
fx:controller="com.bib.essensbestellungsverwaltung.AdminController"
|
<HBox alignment="CENTER" layoutX="58.0" layoutY="221.0" prefHeight="349.0" prefWidth="683.0">
|
||||||
prefHeight="400.0" prefWidth="600.0">
|
<children>
|
||||||
|
<ListView fx:id="listView" prefHeight="349.0" prefWidth="300.0" />
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
<Text layoutX="88.0" layoutY="68.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Tagesbestellung">
|
||||||
|
<font>
|
||||||
|
<Font name="System Bold" size="25.0" />
|
||||||
|
</font>
|
||||||
|
</Text>
|
||||||
|
<DatePicker fx:id="datePicker" layoutX="88.0" layoutY="142.0" onAction="#onChangeDate" />
|
||||||
|
<Label layoutX="88.0" layoutY="121.0" text="Datum" />
|
||||||
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
Loading…
Reference in New Issue
Block a user