add: simple dailyOrder view
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Johannes Kantz
					Johannes Kantz