add: simple dailyOrder view
This commit is contained in:
parent
e33e3d8ccb
commit
c49d3cb699
@ -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){
|
||||
List<String> orders = new ArrayList<>();
|
||||
FoodPlan food_plan = getFoodPlan(date);
|
||||
if(food_plan == null){
|
||||
return orders;
|
||||
}
|
||||
String sId = String.valueOf(food_plan.getId());
|
||||
String[] food_selectionH = {"food_planid","foodid"};
|
||||
Food[] foodArray = {
|
||||
|
@ -27,13 +27,13 @@ public class WorkerMenuController {
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
changePage("menue-view.fxml");
|
||||
changePage("dailyOrder-view.fxml");
|
||||
setButtonActive(tagesbestellungButton);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void onTagesbestellungenClick(MouseEvent mouseEvent) {
|
||||
changePage("menue-view.fxml");
|
||||
changePage("dailyOrder-view.fxml");
|
||||
setButtonActive(tagesbestellungButton);
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.*?>
|
||||
<?import java.util.*?>
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="com.bib.essensbestellungsverwaltung.AdminController"
|
||||
prefHeight="400.0" prefWidth="600.0">
|
||||
|
||||
<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">
|
||||
<children>
|
||||
<HBox alignment="CENTER" layoutX="58.0" layoutY="221.0" prefHeight="349.0" prefWidth="683.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>
|
||||
|
Loading…
Reference in New Issue
Block a user