Compare commits
	
		
			25 Commits
		
	
	
		
			f0bd39d3a6
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					5d455c6291 | ||
| 93512fa4fa | |||
| 
						 | 
					1d9070551e | ||
| 
						 | 
					cf9ba3d3f9 | ||
| 8ed1085e40 | |||
| 72412b3b47 | |||
| 
						 | 
					fd36d1ab97 | ||
| 
						 | 
					7f96fc4b8a | ||
| 
						 | 
					cdafca2e54 | ||
| 8b7a611e2a | |||
| 336a6fc89d | |||
| 0303458524 | |||
| f97211ae84 | |||
| c127cfb8a3 | |||
| 293c5f7fee | |||
| 956c723057 | |||
| ee2685cd45 | |||
| 8f8597c0c9 | |||
| a620c620f0 | |||
| 43f0aeb352 | |||
| 29c31841fa | |||
| 349a8f02cc | |||
| 58ab3e313c | |||
| bc4926aca8 | |||
| 7acd24e285 | 
							
								
								
									
										2
									
								
								.idea/.name
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.idea/.name
									
									
									
										generated
									
									
									
								
							@@ -1 +1 @@
 | 
				
			|||||||
HelloController.java
 | 
					Essensverwaltung.java
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								out/artifacts/VPR_App_jar/VPR_App.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								out/artifacts/VPR_App_jar/VPR_App.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										20
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								pom.xml
									
									
									
									
									
								
							@@ -76,6 +76,26 @@
 | 
				
			|||||||
                    </execution>
 | 
					                    </execution>
 | 
				
			||||||
                </executions>
 | 
					                </executions>
 | 
				
			||||||
            </plugin>
 | 
					            </plugin>
 | 
				
			||||||
 | 
					            <plugin>
 | 
				
			||||||
 | 
					                <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					                <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					                <version>3.2.1</version>
 | 
				
			||||||
 | 
					                <executions>
 | 
				
			||||||
 | 
					                    <execution>
 | 
				
			||||||
 | 
					                        <phase>package</phase>
 | 
				
			||||||
 | 
					                        <goals>
 | 
				
			||||||
 | 
					                            <goal>shade</goal>
 | 
				
			||||||
 | 
					                        </goals>
 | 
				
			||||||
 | 
					                        <configuration>
 | 
				
			||||||
 | 
					                            <transformers>
 | 
				
			||||||
 | 
					                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
 | 
				
			||||||
 | 
					                                    <mainClass>de.subway_surfers.vpr_app.Main</mainClass>
 | 
				
			||||||
 | 
					                                </transformer>
 | 
				
			||||||
 | 
					                            </transformers>
 | 
				
			||||||
 | 
					                        </configuration>
 | 
				
			||||||
 | 
					                    </execution>
 | 
				
			||||||
 | 
					                </executions>
 | 
				
			||||||
 | 
					            </plugin>
 | 
				
			||||||
        </plugins>
 | 
					        </plugins>
 | 
				
			||||||
    </build>
 | 
					    </build>
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
@@ -5,6 +5,10 @@ package Logik;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import RestAPISchnittstelle.RestApiClient;
 | 
					import RestAPISchnittstelle.RestApiClient;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Sven Alteköster und Samuel Wolff
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class Account {
 | 
					public class Account {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// region Felder
 | 
						// region Felder
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,9 @@ package Logik;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Samuel Wolff
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class ElternAccount extends Account {
 | 
					public class ElternAccount extends Account {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// region Felder
 | 
						// region Felder
 | 
				
			||||||
@@ -37,6 +40,7 @@ public class ElternAccount extends Account {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Lädt eine Rechnung herunter
 | 
						 * Lädt eine Rechnung herunter
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void rechnungHerunterladen() {
 | 
						public void rechnungHerunterladen() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -44,6 +48,7 @@ public class ElternAccount extends Account {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Bestellt eine Mahlzeit
 | 
						 * Bestellt eine Mahlzeit
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void mahlzeitBestellen() {
 | 
						public void mahlzeitBestellen() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,6 +57,7 @@ public class ElternAccount extends Account {
 | 
				
			|||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Zeigt Rechnungen gefiltert an
 | 
						 * Zeigt Rechnungen gefiltert an
 | 
				
			||||||
	 * @param params Die Filter Argumente
 | 
						 * @param params Die Filter Argumente
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void rechnungAnzeigen(String params) {
 | 
						public void rechnungAnzeigen(String params) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,9 @@ package Logik;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Samuel Wolff und Sven Alteköster
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class Kind {
 | 
					public class Kind {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// region Felder
 | 
						// region Felder
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,10 +1,13 @@
 | 
				
			|||||||
package Logik;
 | 
					package Logik;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.time.LocalDate;
 | 
					 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.Date;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Sven Alteköster
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class Mahlzeit {
 | 
					public class Mahlzeit {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private int id;
 | 
				
			||||||
	private String name;
 | 
						private String name;
 | 
				
			||||||
	private float            preis;
 | 
						private float            preis;
 | 
				
			||||||
	private ArrayList<Zutat> zutaten;
 | 
						private ArrayList<Zutat> zutaten;
 | 
				
			||||||
@@ -17,7 +20,6 @@ public class Mahlzeit {
 | 
				
			|||||||
		zutaten = new ArrayList<>();
 | 
							zutaten = new ArrayList<>();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
	public String getName() {
 | 
						public String getName() {
 | 
				
			||||||
		return name;
 | 
							return name;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -39,4 +41,6 @@ public class Mahlzeit {
 | 
				
			|||||||
		return String.format("Name: %s, Preis: %g, Beschreibung: %s", name, preis, beschreibung);
 | 
							return String.format("Name: %s, Preis: %g, Beschreibung: %s", name, preis, beschreibung);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,9 @@ package Logik;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Samuel Wolff
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class MitarbeiterAccount extends Account {
 | 
					public class MitarbeiterAccount extends Account {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// region Konstrukoren
 | 
						// region Konstrukoren
 | 
				
			||||||
@@ -25,12 +28,12 @@ public class MitarbeiterAccount extends Account {
 | 
				
			|||||||
	 * @param passwort Das neue Passwort
 | 
						 * @param passwort Das neue Passwort
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void passwortZurzecksetzen(Account other, String passwort) {
 | 
						public void passwortZurzecksetzen(Account other, String passwort) {
 | 
				
			||||||
		// Soll das so?
 | 
					 | 
				
			||||||
		other.setPasswort(passwort);
 | 
							other.setPasswort(passwort);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Bestellt eine Mahlzeit
 | 
						 * Bestellt eine Mahlzeit
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void mahlzeitBestellen() {
 | 
						public void mahlzeitBestellen() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -38,6 +41,7 @@ public class MitarbeiterAccount extends Account {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Ändert einen Tagesplan
 | 
						 * Ändert einen Tagesplan
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void tagesplanAendern() {
 | 
						public void tagesplanAendern() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -59,25 +63,24 @@ public class MitarbeiterAccount extends Account {
 | 
				
			|||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Zeigt Rechnungen gefilter nach params an
 | 
						 * Zeigt Rechnungen gefilter nach params an
 | 
				
			||||||
	 * @param params Die Filter Arguemente
 | 
						 * @param params Die Filter Arguemente
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void rechnungAnzeigen(String[] params) {
 | 
						public void rechnungAnzeigen(String[] params) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO sollte hier nicht noch ein User mitgegeben werden?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Weist ein Kind einem Account zu
 | 
						 * Weist ein Kind einem Account zu
 | 
				
			||||||
	 * @param kind Das zuzuweisende Kind
 | 
						 * @param kind Das zuzuweisende Kind
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void kinderZuweisen(Kind kind) {
 | 
						public void kinderZuweisen(Kind kind) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// TODO hier auch?
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Zeigt einen Benutzer an
 | 
						 * Zeigt einen Benutzer an
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void zeigeBenutzer() {
 | 
						public void zeigeBenutzer() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,9 @@ package Logik;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Sven Alteköster
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class Tagesplan {
 | 
					public class Tagesplan {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private ArrayList<Mahlzeit> gerichte;
 | 
						private ArrayList<Mahlzeit> gerichte;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,8 @@
 | 
				
			|||||||
package Logik;
 | 
					package Logik;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Sven Alteköster
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public class Zutat {
 | 
					public class Zutat {
 | 
				
			||||||
	private String name;
 | 
						private String name;
 | 
				
			||||||
	public Zutat (String name) {
 | 
						public Zutat (String name) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package RestAPISchnittstelle;
 | 
					package RestAPISchnittstelle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author Samuel Wolff
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
public interface IRestAPI {
 | 
					public interface IRestAPI {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// region Get
 | 
						// region Get
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,8 +17,6 @@ import com.google.gson.*;
 | 
				
			|||||||
import javafx.scene.control.Alert;
 | 
					import javafx.scene.control.Alert;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * noch nicht getestet
 | 
					 | 
				
			||||||
 * TODO FERTIG MACHEN
 | 
					 | 
				
			||||||
 * @author Samuel Wolff
 | 
					 * @author Samuel Wolff
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
public class RestApiClient implements IRestAPI{
 | 
					public class RestApiClient implements IRestAPI{
 | 
				
			||||||
@@ -36,23 +34,11 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
		gson = new Gson();
 | 
							gson = new Gson();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static void main(String[] args){
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		RestApiClient client1 = new RestApiClient();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		client1.delete("Kind", 15);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		Tagesplan t = client1.getGerichteOnTag("2023-12-17");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		for(Mahlzeit m : t.getGerichte())
 | 
					 | 
				
			||||||
			System.out.println(m);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Methode für einen Get-Aufruf. Ruft alle Elemente einer Tabelle auf.
 | 
						 * Methode für einen Get-Aufruf. Ruft alle Elemente einer Tabelle auf.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param controllerName Name des aufzurufenden Controllers
 | 
						 * @param controllerName Name des aufzurufenden Controllers
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public String get(String controllerName) {
 | 
						public String get(String controllerName) {
 | 
				
			||||||
@@ -69,8 +55,8 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
								// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
			return httpResponse.body();
 | 
								return httpResponse.body();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch(ConnectException conex){
 | 
							catch(ConnectException conex){
 | 
				
			||||||
@@ -90,6 +76,7 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param controllerName Name des aufzurufenden Controllers
 | 
						 * @param controllerName Name des aufzurufenden Controllers
 | 
				
			||||||
	 * @param id Id der Aufzurufenden Zeile
 | 
						 * @param id Id der Aufzurufenden Zeile
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public String get(String controllerName, int id) {
 | 
						public String get(String controllerName, int id) {
 | 
				
			||||||
@@ -106,7 +93,7 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
								// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			return httpResponse.body();
 | 
								return httpResponse.body();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -125,11 +112,14 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 | 
						 * --DEPRECATED--
 | 
				
			||||||
	 * Methode für einen Get-Aufruf. Ruft ein spezielles Element auf.
 | 
						 * Methode für einen Get-Aufruf. Ruft ein spezielles Element auf.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param controllerName Name des aufzurufenden Controllers
 | 
						 * @param controllerName Name des aufzurufenden Controllers
 | 
				
			||||||
	 * @param id Id der Aufzurufenden Zeile
 | 
						 * @param id Id der Aufzurufenden Zeile
 | 
				
			||||||
	 * @param bezahlt TODO Warum ist das hier?
 | 
						 * @param bezahlt TODO Warum ist das hier?
 | 
				
			||||||
 | 
						 * @deprecated
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public String get(String controllerName, int id, boolean bezahlt) {
 | 
						public String get(String controllerName, int id, boolean bezahlt) {
 | 
				
			||||||
@@ -146,8 +136,8 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
								// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
			return httpResponse.body();
 | 
								return httpResponse.body();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch(ConnectException conex){
 | 
							catch(ConnectException conex){
 | 
				
			||||||
@@ -162,6 +152,13 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/***
 | 
				
			||||||
 | 
						 * Ein gefilterter Get Aufruf
 | 
				
			||||||
 | 
						 * @param controllerName
 | 
				
			||||||
 | 
						 * @param params
 | 
				
			||||||
 | 
						 * @return
 | 
				
			||||||
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public String get(String controllerName, String[] params) {
 | 
						public String get(String controllerName, String[] params) {
 | 
				
			||||||
		String ende = "";
 | 
							String ende = "";
 | 
				
			||||||
@@ -181,8 +178,8 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode() + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			return httpResponse.body();
 | 
								return httpResponse.body();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -206,6 +203,7 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 * @param controllerName Name des aufzurufenden Controllers.
 | 
						 * @param controllerName Name des aufzurufenden Controllers.
 | 
				
			||||||
	 * @param id Id des zu änderenden Eintrags.
 | 
						 * @param id Id des zu änderenden Eintrags.
 | 
				
			||||||
	 * @param jsonData JsonString mit den neuen Daten.
 | 
						 * @param jsonData JsonString mit den neuen Daten.
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public void put(String controllerName, int id, String jsonData) {
 | 
						public void put(String controllerName, int id, String jsonData) {
 | 
				
			||||||
@@ -223,9 +221,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch(ConnectException conex){
 | 
							catch(ConnectException conex){
 | 
				
			||||||
			Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
								Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
				
			||||||
@@ -242,12 +240,13 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param controllerName Name des aufzurufenden Controllers.
 | 
						 * @param controllerName Name des aufzurufenden Controllers.
 | 
				
			||||||
	 * @param jsonData JsonString mit den Daten des Eintrags.
 | 
						 * @param jsonData JsonString mit den Daten des Eintrags.
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public void post(String controllerName, String jsonData) {
 | 
						public void post(String controllerName, String jsonData) {
 | 
				
			||||||
		URI apiUri = URI.create(String.format("%s/%s", urlBase,controllerName));
 | 
							URI apiUri = URI.create(String.format("%s/%s", urlBase,controllerName));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		System.out.println(apiUri);
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
											 .timeout(Duration.ofSeconds(timeout))
 | 
																 .timeout(Duration.ofSeconds(timeout))
 | 
				
			||||||
@@ -260,9 +259,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch(ConnectException conex){
 | 
							catch(ConnectException conex){
 | 
				
			||||||
			Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
								Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
				
			||||||
@@ -279,12 +278,13 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param controllerName Name des aufzurufenden Controllers
 | 
						 * @param controllerName Name des aufzurufenden Controllers
 | 
				
			||||||
	 * @param id Id des zu löschenden Eintrags.
 | 
						 * @param id Id des zu löschenden Eintrags.
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public void delete(String controllerName, int id) {
 | 
						public void delete(String controllerName, int id) {
 | 
				
			||||||
		URI apiUri = URI.create(String.format("%s/%s/%d", urlBase,controllerName, id));
 | 
							URI apiUri = URI.create(String.format("%s/%s/%d", urlBase,controllerName, id));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		System.out.println(apiUri);
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
											 .timeout(Duration.ofSeconds(timeout))
 | 
																 .timeout(Duration.ofSeconds(timeout))
 | 
				
			||||||
@@ -297,9 +297,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch(ConnectException conex){
 | 
							catch(ConnectException conex){
 | 
				
			||||||
			Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
								Alert alert = new Alert(Alert.AlertType.INFORMATION);
 | 
				
			||||||
@@ -311,6 +311,12 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/***
 | 
				
			||||||
 | 
						 * Holt die nöchste Autoinkrement Id für den mitgegebenen Controller aus der Datenbank
 | 
				
			||||||
 | 
						 * @param controllerName
 | 
				
			||||||
 | 
						 * @return
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public int nextId(String controllerName){
 | 
						public int nextId(String controllerName){
 | 
				
			||||||
		URI apiUri = URI.create(String.format("%s/%s/nextId", urlBase, controllerName));
 | 
							URI apiUri = URI.create(String.format("%s/%s/nextId", urlBase, controllerName));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -324,9 +330,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
 | 
								JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
 | 
				
			||||||
			JsonArray jsonArray = jsonElement.getAsJsonArray();
 | 
								JsonArray jsonArray = jsonElement.getAsJsonArray();
 | 
				
			||||||
@@ -353,6 +359,7 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param credentials Die Anmeldedaten in Json-String form
 | 
						 * @param credentials Die Anmeldedaten in Json-String form
 | 
				
			||||||
	 * @return True oder false, je nach Erfolg des Anmeldeversuchs
 | 
						 * @return True oder false, je nach Erfolg des Anmeldeversuchs
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public boolean anmeldeVersuch(String credentials){
 | 
						public boolean anmeldeVersuch(String credentials){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -364,7 +371,7 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
		passwort = passwort.substring(1, passwort.length()-1);
 | 
							passwort = passwort.substring(1, passwort.length()-1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		URI apiUri = URI.create(String.format("%s/Benutzer/anmeldeVersuch?Benutzername=%s&passwort=%s", urlBase, benutzer, passwort));
 | 
							URI apiUri = URI.create(String.format("%s/Benutzer/anmeldeVersuch?Benutzername=%s&passwort=%s", urlBase, benutzer, passwort));
 | 
				
			||||||
		System.out.println(apiUri);
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
		HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
											 .timeout(Duration.ofSeconds(timeout))
 | 
																 .timeout(Duration.ofSeconds(timeout))
 | 
				
			||||||
											 .uri(apiUri)
 | 
																 .uri(apiUri)
 | 
				
			||||||
@@ -376,9 +383,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
			if(httpResponse.body().equals("true"))
 | 
								if(httpResponse.body().equals("true"))
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			else{
 | 
								else{
 | 
				
			||||||
@@ -409,11 +416,12 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param datum Das angeforderte Datum in String Form (YYYY-MM-DD)
 | 
						 * @param datum Das angeforderte Datum in String Form (YYYY-MM-DD)
 | 
				
			||||||
	 * @return Ein Tagesplan Objekt mit allen Gerichten
 | 
						 * @return Ein Tagesplan Objekt mit allen Gerichten
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public Tagesplan getGerichteOnTag(String datum){
 | 
						public Tagesplan getGerichteOnTag(String datum){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichteOnTag?datum=%s", urlBase, datum));
 | 
							URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichteOnTag?datum=%s", urlBase, datum));
 | 
				
			||||||
		System.out.println(apiUri);
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
		HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
											 .timeout(Duration.ofSeconds(timeout))
 | 
																 .timeout(Duration.ofSeconds(timeout))
 | 
				
			||||||
											 .uri(apiUri)
 | 
																 .uri(apiUri)
 | 
				
			||||||
@@ -425,9 +433,9 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
			// Send the request and get the response
 | 
								// Send the request and get the response
 | 
				
			||||||
			HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// Print the response status code and body
 | 
					//			// Print the response status code and body
 | 
				
			||||||
			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
			System.out.println("Response Body: " + httpResponse.body());
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Tagesplan t = new Tagesplan(datum);
 | 
								Tagesplan t = new Tagesplan(datum);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -461,4 +469,71 @@ public class RestApiClient implements IRestAPI{
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Holt die Id des Gerichtes mit dem mitgegebenen Namen an einem mitgegebenen Tag und gibt sie zurück
 | 
				
			||||||
 | 
						 * @param name
 | 
				
			||||||
 | 
						 * @param datum
 | 
				
			||||||
 | 
						 * @return
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public int getGerichtIdOnTag(String name, String datum){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							URI apiUri = URI.create(String.format("%s/Tagesplan/getGerichtIdOnTag?name=%s&datum=%s", urlBase, name, datum));
 | 
				
			||||||
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
 | 
																 .uri(apiUri)
 | 
				
			||||||
 | 
																 .header("Content-Type", "application/json")
 | 
				
			||||||
 | 
																 .GET()
 | 
				
			||||||
 | 
																 .build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								// Send the request and get the response
 | 
				
			||||||
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//			// Print the response status code and body
 | 
				
			||||||
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
 | 
					//			System.out.println("Response Body: " + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								JsonElement jsonElement = JsonParser.parseString(httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								JsonArray json = jsonElement.getAsJsonArray();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								JsonObject o = json.get(0).getAsJsonObject();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								return o.get("id").getAsInt();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							} catch (Exception e) {
 | 
				
			||||||
 | 
								e.printStackTrace();
 | 
				
			||||||
 | 
								return -1;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Löscht ein Gericht mit der mitgebenen Id aus der Datenbank
 | 
				
			||||||
 | 
						 * @param id
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public void deleteGericht(int id){
 | 
				
			||||||
 | 
							URI apiUri = URI.create(String.format("%s/Tagesplan/%d", urlBase, id));
 | 
				
			||||||
 | 
							//System.out.println(apiUri);
 | 
				
			||||||
 | 
							HttpRequest httpRequest = HttpRequest.newBuilder()
 | 
				
			||||||
 | 
																 .uri(apiUri)
 | 
				
			||||||
 | 
																 .header("Content-Type", "application/json")
 | 
				
			||||||
 | 
																 .DELETE()
 | 
				
			||||||
 | 
																 .build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								// Send the request and get the response
 | 
				
			||||||
 | 
								HttpResponse<String> httpResponse = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//			// Print the response status code and body
 | 
				
			||||||
 | 
					//			System.out.println("Status Code: " + httpResponse.statusCode());
 | 
				
			||||||
 | 
					//			System.out.println("Delete Gericht: Response Body: " + httpResponse.body());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							} catch (Exception e) {
 | 
				
			||||||
 | 
								e.printStackTrace();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,6 +35,10 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private ArrayList<Kind> kinder;
 | 
						private ArrayList<Kind> kinder;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Initialisiert die Accounterstellungsmaske
 | 
				
			||||||
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void initialize() {
 | 
						public void initialize() {
 | 
				
			||||||
		//Die Radiobuttons zum auswählen eines Accountypes werden einer ToggleGroup hinzugefügt
 | 
							//Die Radiobuttons zum auswählen eines Accountypes werden einer ToggleGroup hinzugefügt
 | 
				
			||||||
		accountTyp = new ToggleGroup();
 | 
							accountTyp = new ToggleGroup();
 | 
				
			||||||
@@ -43,6 +47,7 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		einmalpw.setText(einmalPwGenerieren());
 | 
							einmalpw.setText(einmalPwGenerieren());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//kinder wird initialisiert
 | 
				
			||||||
		kinder = new ArrayList<>();
 | 
							kinder = new ArrayList<>();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -62,7 +67,7 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
	 * @author Sven Alteköster
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void onAbmelden(ActionEvent actionEvent) {
 | 
						public void onAbmelden(ActionEvent actionEvent) {
 | 
				
			||||||
		//VerwaltungApplication.abmelden();
 | 
							VerwaltungApplication.abmelden();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
@@ -190,7 +195,10 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void onSpeichern(ActionEvent actionEvent) {
 | 
						public void onSpeichern(ActionEvent actionEvent) {
 | 
				
			||||||
		if (eingabenGueltig()) {
 | 
							if (eingabenGueltig()) {
 | 
				
			||||||
			//Zeigt generiert ein Einmalpasswort und zeigt es an
 | 
								//speichert das aktuelle Passwort zwischen
 | 
				
			||||||
 | 
								String passwort = einmalpw.getText();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								//generiert ein neues Einmalpasswort und zeigt es an
 | 
				
			||||||
			einmalpw.setText(einmalPwGenerieren());
 | 
								einmalpw.setText(einmalPwGenerieren());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Schnittstelle zur RestAPI
 | 
								//Schnittstelle zur RestAPI
 | 
				
			||||||
@@ -213,23 +221,20 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
			Account neuer;
 | 
								Account neuer;
 | 
				
			||||||
			//Handelt es sich um einen Elternaccount, werden alle Eingegebenen Kinder erstellt.
 | 
								//Handelt es sich um einen Elternaccount, werden alle Eingegebenen Kinder erstellt.
 | 
				
			||||||
			if (typEltern.isSelected()) {
 | 
								if (typEltern.isSelected()) {
 | 
				
			||||||
				neuer = new ElternAccount(String.format("%d",einmalpw.getText().hashCode()), accountname.getText(), email.getText());
 | 
									neuer = new ElternAccount(passwort, accountname.getText(), email.getText());
 | 
				
			||||||
				//Kinder dem neuen Account hinzufügen
 | 
									//Kinder dem neuen Account hinzufügen
 | 
				
			||||||
				for (Kind k : kinder) {
 | 
									for (Kind k : kinder) {
 | 
				
			||||||
					((ElternAccount)neuer).getKinder().add(k);
 | 
										((ElternAccount)neuer).getKinder().add(k);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else if (typMitarbeiter.isSelected()) {
 | 
								else if (typMitarbeiter.isSelected()) {
 | 
				
			||||||
				neuer = new MitarbeiterAccount(String.format("%d",einmalpw.getText().hashCode()), accountname.getText(), email.getText());
 | 
									neuer = new MitarbeiterAccount(passwort, accountname.getText(), email.getText());
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			//Ist kein Radio Button ausgewählt, wird hier abgebrochen
 | 
								//Ist kein Radio Button ausgewählt, wird hier abgebrochen
 | 
				
			||||||
			else {
 | 
								else {
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//Die Liste, zum Speichern der gespeicherten Liste wird zurückgesetzt, da die Kinder jetzt im Elternobjekt gespeichert werden
 | 
					 | 
				
			||||||
			kinder.clear();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			//Das Elternelement wird in der DB gespeichert, wenn es keinen gleichnamigen Account gibt.
 | 
								//Das Elternelement wird in der DB gespeichert, wenn es keinen gleichnamigen Account gibt.
 | 
				
			||||||
			if (!kontoVorhanden) {
 | 
								if (!kontoVorhanden) {
 | 
				
			||||||
				api.post("Benutzer", gson.toJson(neuer));
 | 
									api.post("Benutzer", gson.toJson(neuer));
 | 
				
			||||||
@@ -241,7 +246,19 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
				for (Kind k : ((ElternAccount)neuer).getKinder()) {
 | 
									for (Kind k : ((ElternAccount)neuer).getKinder()) {
 | 
				
			||||||
					//setzen des Fremdschlüssels bid
 | 
										//setzen des Fremdschlüssels bid
 | 
				
			||||||
					k.setBid(id);
 | 
										k.setBid(id);
 | 
				
			||||||
					api.post("Kind", gson.toJson(k));
 | 
										String neues = gson.toJson(k);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										//region hässlich
 | 
				
			||||||
 | 
										neues = neues.replaceAll("ä", "ae");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("ö", "oe");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("ü", "ue");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("Ä", "Ae");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("Ö", "Oe");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("Ü", "Ue");
 | 
				
			||||||
 | 
										neues = neues.replaceAll("ß", "ss");
 | 
				
			||||||
 | 
										//endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										api.post("Kind", neues);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			status.setText("Daten Erfolgreich gespeichert");
 | 
								status.setText("Daten Erfolgreich gespeichert");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,13 +23,18 @@ public class BestelluebersichtMitarbeiter {
 | 
				
			|||||||
	@FXML
 | 
						@FXML
 | 
				
			||||||
	private Accordion accordion;
 | 
						private Accordion accordion;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Initialisiert die Bestellübersicht durch Erstellung eines Accordion mit TitledPanes für verschiedene Datumsangaben.
 | 
				
			||||||
 | 
						 * Geschrieben von: Stefan Groß
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void initialize() {
 | 
						public void initialize() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		List<String> datum = new ArrayList<>();
 | 
							List<String> datum = new ArrayList<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		datum.add("15.10.1999");
 | 
							//Placeholder für richtige Daten
 | 
				
			||||||
		datum.add("23.12.2002");
 | 
							datum.add("15.10.2023");
 | 
				
			||||||
		datum.add("05.01.2020");
 | 
							datum.add("23.12.2023");
 | 
				
			||||||
 | 
							datum.add("05.01.2024");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		accordion.setStyle("-fx-box-border: transparent;");
 | 
							accordion.setStyle("-fx-box-border: transparent;");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,41 +47,33 @@ public class BestelluebersichtMitarbeiter {
 | 
				
			|||||||
			datumUeberschrift.animatedProperty().set(false);
 | 
								datumUeberschrift.animatedProperty().set(false);
 | 
				
			||||||
			datumUeberschrift.setPadding(new Insets(0, 0, 15, 0));
 | 
								datumUeberschrift.setPadding(new Insets(0, 0, 15, 0));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			//TitledPane personen = new TitledPane("Person", createPersonenAccordion());
 | 
					 | 
				
			||||||
			accordion.getPanes().add(datumUeberschrift);
 | 
								accordion.getPanes().add(datumUeberschrift);
 | 
				
			||||||
			//gerichtAkkordion.getPanes().add(personen);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
 | 
							scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
 | 
				
			||||||
		scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
 | 
							scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int anzahlGerichtA = 1;
 | 
						/**
 | 
				
			||||||
 | 
						 * Erstellt ein Accordion mit TitledPanes für die Bestellübersicht der Gerichte und Nachtische.
 | 
				
			||||||
 | 
						 * Geschrieben von: Stefan Groß
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public Accordion createGerichtAkkordion() {
 | 
						public Accordion createGerichtAkkordion() {
 | 
				
			||||||
		Accordion accordion = new Accordion();
 | 
							Accordion accordion = new Accordion();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Placeholder für richtige Daten
 | 
				
			||||||
		int anzahlGerichtB = 15;
 | 
							int anzahlGerichtB = 15;
 | 
				
			||||||
		int anzahlGerichtC = 3;
 | 
							int anzahlGerichtC = 3;
 | 
				
			||||||
		int anzahlGerichtD = 2;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		double preisGerichtA = 4.99;
 | 
							double preisGerichtB = 4.99;
 | 
				
			||||||
		double preisGerichtB = 9.99;
 | 
							double preisGerichtC = 9.99;
 | 
				
			||||||
		double preisGerichtC = 3.99;
 | 
					 | 
				
			||||||
		double preisGerichtD = 12.49;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		int anzahlNachtischA = 2;
 | 
							int anzahlNachtischA = 2;
 | 
				
			||||||
		int anzahlNachtischB = 213;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		double preisNachtischA = 0.49;
 | 
							double preisNachtischA = 0.49;
 | 
				
			||||||
		double preisNachtischB = 99.49;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (anzahlGerichtA >= 1) {
 | 
					 | 
				
			||||||
			TitledPane tp = new TitledPane();
 | 
					 | 
				
			||||||
			tp.setText("GerichtA " + anzahlGerichtA + "-Mal " + preisGerichtA * anzahlGerichtA + " €");
 | 
					 | 
				
			||||||
			accordion.getPanes().addAll(tp);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (anzahlGerichtB >= 1) {
 | 
							if (anzahlGerichtB >= 1) {
 | 
				
			||||||
			TitledPane tp = new TitledPane();
 | 
								TitledPane tp = new TitledPane();
 | 
				
			||||||
			tp.setText("GerichtB " + anzahlGerichtB + "-Mal " + preisGerichtB * anzahlGerichtB + " €");
 | 
								tp.setText("GerichtB " + anzahlGerichtB + "-Mal " + preisGerichtB * anzahlGerichtB + " €");
 | 
				
			||||||
@@ -90,12 +87,6 @@ public class BestelluebersichtMitarbeiter {
 | 
				
			|||||||
			accordion.getPanes().addAll(tp);
 | 
								accordion.getPanes().addAll(tp);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (anzahlGerichtD >= 1) {
 | 
					 | 
				
			||||||
			TitledPane tp = new TitledPane();
 | 
					 | 
				
			||||||
			tp.setText("GerichtD " + anzahlGerichtD + "-Mal " + preisGerichtD * anzahlGerichtD + " €");
 | 
					 | 
				
			||||||
			accordion.getPanes().addAll(tp);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (anzahlNachtischA >= 1) {
 | 
							if (anzahlNachtischA >= 1) {
 | 
				
			||||||
			TitledPane tp = new TitledPane();
 | 
								TitledPane tp = new TitledPane();
 | 
				
			||||||
			tp.setText("NachtischA " + anzahlNachtischA + "-Mal " + preisNachtischA * anzahlNachtischA + " €");
 | 
								tp.setText("NachtischA " + anzahlNachtischA + "-Mal " + preisNachtischA * anzahlNachtischA + " €");
 | 
				
			||||||
@@ -104,43 +95,21 @@ public class BestelluebersichtMitarbeiter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		if (anzahlNachtischA >= 1) {
 | 
							if (anzahlNachtischA >= 1) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Label label2 = new Label("Hans Schwanz" + " für " + " Anja Arbeitslos");
 | 
								Label label2 = new Label("Beispiel Eltern bestellen \"essen\" für Kind: Anja Arbeitslos");
 | 
				
			||||||
			Label label3 = new Label("Drittes Label");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			VBox vbox = new VBox(label2, label3);
 | 
								VBox vbox = new VBox(label2);
 | 
				
			||||||
			vbox.setAlignment(Pos.CENTER_LEFT);
 | 
								vbox.setAlignment(Pos.CENTER_LEFT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			TitledPane tp = new TitledPane("NachtischB " + "-Mal " + preisNachtischB * anzahlGerichtB + " €", vbox);
 | 
								TitledPane tp = new TitledPane("NachtischB " + "-Mal " + preisNachtischA * anzahlGerichtB + " €", vbox);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			accordion.getPanes().addAll(tp);
 | 
								accordion.getPanes().addAll(tp);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return accordion;
 | 
							return accordion;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
					 | 
				
			||||||
	public Accordion createPersonenAccordion() {
 | 
					 | 
				
			||||||
		Accordion accordion1 = new Accordion();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		for (int i = 0; i < 10; i++) {
 | 
					 | 
				
			||||||
			String kind = "Kind";
 | 
					 | 
				
			||||||
			String elternteil = "Max Heer";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			Label label = new Label();
 | 
					 | 
				
			||||||
			label.setText(elternteil + " für " + kind);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Erstellen Sie eine TitledPane für jedes Label
 | 
					 | 
				
			||||||
			TitledPane titledPane = new TitledPane("Kind Informationen", label);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			// Fügen Sie die TitledPane zur Accordion hinzu
 | 
					 | 
				
			||||||
			accordion1.getPanes().add(titledPane);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		return accordion1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	*/
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void onAbmelden(ActionEvent event) {
 | 
						public void onAbmelden(ActionEvent event) {
 | 
				
			||||||
		//VerwaltungApplication.abmelden();
 | 
							VerwaltungApplication.abmelden();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void onZurueck(ActionEvent actionEvent) {
 | 
						public void onZurueck(ActionEvent actionEvent) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,9 @@ package de.subway_surfers.vpr_app;
 | 
				
			|||||||
import Logik.Mahlzeit;
 | 
					import Logik.Mahlzeit;
 | 
				
			||||||
import Logik.Tagesplan;
 | 
					import Logik.Tagesplan;
 | 
				
			||||||
import RestAPISchnittstelle.RestApiClient;
 | 
					import RestAPISchnittstelle.RestApiClient;
 | 
				
			||||||
 | 
					import com.google.gson.Gson;
 | 
				
			||||||
 | 
					import com.google.gson.JsonElement;
 | 
				
			||||||
 | 
					import com.google.gson.JsonObject;
 | 
				
			||||||
import javafx.beans.value.ChangeListener;
 | 
					import javafx.beans.value.ChangeListener;
 | 
				
			||||||
import javafx.beans.value.ObservableValue;
 | 
					import javafx.beans.value.ObservableValue;
 | 
				
			||||||
import javafx.collections.FXCollections;
 | 
					import javafx.collections.FXCollections;
 | 
				
			||||||
@@ -23,6 +26,7 @@ import javafx.stage.Stage;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import java.net.http.WebSocket;
 | 
					import java.net.http.WebSocket;
 | 
				
			||||||
import java.text.DateFormat;
 | 
					import java.text.DateFormat;
 | 
				
			||||||
 | 
					import java.time.LocalDate;
 | 
				
			||||||
import java.time.LocalTime;
 | 
					import java.time.LocalTime;
 | 
				
			||||||
import java.time.format.DateTimeFormatter;
 | 
					import java.time.format.DateTimeFormatter;
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
@@ -41,64 +45,64 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private String date;
 | 
						private String date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private String day;
 | 
						/**
 | 
				
			||||||
 | 
						 * Initialize des Controllers.
 | 
				
			||||||
	private String month;
 | 
						 * Setzt das Datum, holt die Gerichte ein und initialisiert die responsive grid.
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	private String year;
 | 
						 */
 | 
				
			||||||
 | 
					 | 
				
			||||||
	private ChangeListener listener;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void initialize(){
 | 
						public void initialize(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
							date = LocalDate.now().toString();
 | 
				
			||||||
		(obs,oldValue,newValue) -> {
 | 
					 | 
				
			||||||
			final int zeile = 1;
 | 
					 | 
				
			||||||
			for (Node n : tagesplan.getChildren()){
 | 
					 | 
				
			||||||
				if(n instanceof Control  && GridPane.getRowIndex(n) == zeile){
 | 
					 | 
				
			||||||
					((Control) n).setPrefHeight(newValue.floatValue());
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		*/
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		DateFormat dateFormat = DateFormat.getDateInstance();
 | 
							dateLabel.setText(date);
 | 
				
			||||||
		date = dateFormat.format(new Date());
 | 
					 | 
				
			||||||
		date = date.replace('.', '-');
 | 
					 | 
				
			||||||
		day = date.split("-")[0];
 | 
					 | 
				
			||||||
		month = date.split("-")[1];
 | 
					 | 
				
			||||||
		year = date.split("-")[2];
 | 
					 | 
				
			||||||
		date = String.format("%s-%s-%s", year, month, day);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		dateLabel.setText(String.format("%s.%s.%s", day, month, year));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		initGrid();
 | 
							initGrid();
 | 
				
			||||||
		initGerichte();
 | 
							initGerichte();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Methode beim klicken auf den Anmeldebutton. Meldet den User ab
 | 
				
			||||||
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Max Heer
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void onAbmelden(ActionEvent actionEvent) {
 | 
						public void onAbmelden(ActionEvent actionEvent) {
 | 
				
			||||||
		VerwaltungApplication.sceneWechseln("login-view.fxml");
 | 
							VerwaltungApplication.sceneWechseln("login-view.fxml");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Methode beim klicken auf den Filter Button. Öffnet den Filter Dialog.
 | 
				
			||||||
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void onFilter(ActionEvent actionEvent) {
 | 
						public void onFilter(ActionEvent actionEvent) {
 | 
				
			||||||
		Stage stage = new Stage();
 | 
							Stage stage = new Stage();
 | 
				
			||||||
		VerwaltungApplication.sceneWechseln(stage, 450, 400, "inhaltsstoffe_filtern-view.fxml");
 | 
							VerwaltungApplication.sceneWechseln(stage, 450, 400, "inhaltsstoffe_filtern-view.fxml");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Methode beim klicken auf den hinzufügen Button. Öffnet den Dialog zum hinzufügen eines Gerichtes zum aktuellen Tag.
 | 
				
			||||||
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void onHinzufuegen(ActionEvent actionEvent) {
 | 
						public void onHinzufuegen(ActionEvent actionEvent) {
 | 
				
			||||||
		Stage gerichterstellung = new Stage();
 | 
							Stage gerichterstellung = new Stage();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//solange das neu geöffnete Fenster offen ist, wird das Hauptfenster gesperrt
 | 
							//solange das neu geöffnete Fenster offen ist, wird das Hauptfenster gesperrt
 | 
				
			||||||
		gerichterstellung.initModality(Modality.APPLICATION_MODAL);
 | 
							gerichterstellung.initModality(Modality.APPLICATION_MODAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		VerwaltungApplication.sceneWechseln(gerichterstellung, 400, 530, "gerichterstellung_mitarbeiter-view.fxml");
 | 
							VerwaltungApplication.sceneWechseln(gerichterstellung, 500, 700, "gerichterstellung_mitarbeiter-view.fxml");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		gerichterstellung.minWidthProperty().set(420);
 | 
							gerichterstellung.minWidthProperty().set(500);
 | 
				
			||||||
		gerichterstellung.minHeightProperty().set(600);
 | 
							gerichterstellung.minHeightProperty().set(700);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Methode beim klicken auf den Zurück Button. Kehrt zum Startbildschirm zurück.
 | 
				
			||||||
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Max Heer
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void onZurueck(ActionEvent actionEvent) {
 | 
						public void onZurueck(ActionEvent actionEvent) {
 | 
				
			||||||
		VerwaltungApplication.sceneWechseln("hauptmenue_mitarbeiter-view.fxml");
 | 
							VerwaltungApplication.sceneWechseln("hauptmenue_mitarbeiter-view.fxml");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -106,15 +110,16 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Methode bei Klick auf Pfeil links, ändert das Datum und gibt neue Gerichte auf die GUI aus.
 | 
						 * Methode bei Klick auf Pfeil links, ändert das Datum und gibt neue Gerichte auf die GUI aus.
 | 
				
			||||||
	 * @param actionEvent
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void pfeilLinks(ActionEvent actionEvent) {
 | 
						public void pfeilLinks(ActionEvent actionEvent) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		tagesplan.getChildren().clear();
 | 
							tagesplan.getChildren().clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		day = String.valueOf(Integer.parseInt(day)-1);
 | 
							LocalDate datum = LocalDate.parse(date);
 | 
				
			||||||
		date = String.format("%s-%s-%s", year, month, day);
 | 
							datum = datum.minusDays(1);
 | 
				
			||||||
 | 
							date = datum.toString();
 | 
				
			||||||
		dateLabel.setText(String.format("%s.%s.%s", day, month, year));
 | 
							dateLabel.setText(date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		initGerichte();
 | 
							initGerichte();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -123,15 +128,16 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Methode bei Klick auf Pfeil rechts, ändert das Datum und gibt neue Gerichte auf die GUI aus.
 | 
						 * Methode bei Klick auf Pfeil rechts, ändert das Datum und gibt neue Gerichte auf die GUI aus.
 | 
				
			||||||
	 * @param actionEvent
 | 
						 * @param actionEvent
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public void pfeilRechts(ActionEvent actionEvent) {
 | 
						public void pfeilRechts(ActionEvent actionEvent) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		tagesplan.getChildren().clear();
 | 
							tagesplan.getChildren().clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		day = String.valueOf(Integer.parseInt(day)+1);
 | 
							LocalDate datum = LocalDate.parse(date);
 | 
				
			||||||
		date = String.format("%s-%s-%s", year, month, day);
 | 
							datum = datum.plusDays(1);
 | 
				
			||||||
 | 
							date = datum.toString();
 | 
				
			||||||
		dateLabel.setText(String.format("%s.%s.%s", day, month, year));
 | 
							dateLabel.setText(date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		initGerichte();
 | 
							initGerichte();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -139,10 +145,12 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Initialisiert alle Gerichte des aktuellen Datums auf der Seite.
 | 
						 * Initialisiert alle Gerichte des aktuellen Datums auf der Seite.
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	private void initGerichte(){
 | 
						private void initGerichte(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		tagesplan.getStyleClass().clear();
 | 
							tagesplan.getStyleClass().clear();
 | 
				
			||||||
 | 
							tagesplan.getChildren().clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		t = new RestApiClient().getGerichteOnTag(date);
 | 
							t = new RestApiClient().getGerichteOnTag(date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -183,6 +191,10 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
		tagesplan.getStyleClass().add("essensuebersicht_gridlines");
 | 
							tagesplan.getStyleClass().add("essensuebersicht_gridlines");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Initialisiert das responsive grid.
 | 
				
			||||||
 | 
						 * @author Max Heer, Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void initGrid(){
 | 
						public void initGrid(){
 | 
				
			||||||
		for (int i = 0; i < tagesplan.getColumnCount(); i++) {
 | 
							for (int i = 0; i < tagesplan.getColumnCount(); i++) {
 | 
				
			||||||
			ColumnConstraints cc = new ColumnConstraints();
 | 
								ColumnConstraints cc = new ColumnConstraints();
 | 
				
			||||||
@@ -203,10 +215,25 @@ public class EssensverwaltungMitarbeiterView {
 | 
				
			|||||||
		VerwaltungApplication.responsiveBreiteGrid(tagesplan);
 | 
							VerwaltungApplication.responsiveBreiteGrid(tagesplan);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Methode beim klicken auf den Löschen Button eines Tagesplan Elementes
 | 
				
			||||||
 | 
						 * @param a
 | 
				
			||||||
 | 
						 * @author Samuel Wolff
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	private void loeschenButtonKlick(ActionEvent a){
 | 
						private void loeschenButtonKlick(ActionEvent a){
 | 
				
			||||||
		Button btn = (Button) a.getSource();
 | 
							Button btn = (Button) a.getSource();
 | 
				
			||||||
		int col = GridPane.getColumnIndex(btn);
 | 
							int col = GridPane.getColumnIndex(btn);
 | 
				
			||||||
 | 
							Mahlzeit m = t.getGerichte().get(col);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							RestApiClient cl = new RestApiClient();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							int id = cl.getGerichtIdOnTag(t.getGerichte().get(col < 0 ? 0 : col).getName().replace(' ', '_'), date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		t.getGerichte().remove(col);
 | 
							t.getGerichte().remove(col);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//System.out.println("Die Id lautet: " + id + col);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							cl.delete("GibtsAm", id);
 | 
				
			||||||
		initGerichte();
 | 
							initGerichte();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,6 @@ import Logik.Mahlzeit;
 | 
				
			|||||||
import Logik.Zutat;
 | 
					import Logik.Zutat;
 | 
				
			||||||
import RestAPISchnittstelle.RestApiClient;
 | 
					import RestAPISchnittstelle.RestApiClient;
 | 
				
			||||||
import com.google.gson.*;
 | 
					import com.google.gson.*;
 | 
				
			||||||
import javafx.event.ActionEvent;
 | 
					 | 
				
			||||||
import javafx.fxml.FXML;
 | 
					import javafx.fxml.FXML;
 | 
				
			||||||
import javafx.scene.control.*;
 | 
					import javafx.scene.control.*;
 | 
				
			||||||
import javafx.scene.layout.HBox;
 | 
					import javafx.scene.layout.HBox;
 | 
				
			||||||
@@ -20,17 +19,53 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
	private @FXML TextField eingabeName;
 | 
						private @FXML TextField eingabeName;
 | 
				
			||||||
	private @FXML Button buttonInhaltsstoffe;
 | 
						private @FXML Button buttonInhaltsstoffe;
 | 
				
			||||||
	private @FXML TextField eingabeInhaltsstoffe;
 | 
						private @FXML TextField eingabeInhaltsstoffe;
 | 
				
			||||||
	private @FXML Button speichernButton;
 | 
					 | 
				
			||||||
	private @FXML TextField eingabePreis;
 | 
						private @FXML TextField eingabePreis;
 | 
				
			||||||
	private @FXML DatePicker datePicker;
 | 
						private @FXML DatePicker datePicker;
 | 
				
			||||||
 | 
						private @FXML ListView<String> listViewVorschlag;
 | 
				
			||||||
	private @FXML Label status;
 | 
						private @FXML Label status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private ArrayList<Zutat> zutaten;
 | 
						private ArrayList<Zutat> zutaten;
 | 
				
			||||||
	private ArrayList<Mahlzeit> mahlzeiten;
 | 
						private ArrayList<Mahlzeit> mahlzeiten;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Füllt die Listview mit Vorschlägen und enthält den Eventlistener für das Textfeld
 | 
				
			||||||
 | 
						 * Ist außerdem für die Skalierung der Buttons vom Inhaltsstoff zuständig
 | 
				
			||||||
 | 
						 * Geschrieben: Sven Alteköster, Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void initialize() {
 | 
						public void initialize() {
 | 
				
			||||||
		zutaten = new ArrayList<>();
 | 
							zutaten = new ArrayList<>();
 | 
				
			||||||
		mahlzeiten = new ArrayList<>();
 | 
							mahlzeiten = new ArrayList<>();
 | 
				
			||||||
 | 
							datePicker.setEditable(false);
 | 
				
			||||||
 | 
							//Liste mit Daten füllen
 | 
				
			||||||
 | 
							mahlzeiten = getMahlzeiten();
 | 
				
			||||||
 | 
							for (Mahlzeit m : mahlzeiten) {
 | 
				
			||||||
 | 
								listViewVorschlag.getItems().add(m.getName());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Eventlistener für die Eingabe des Textfelds
 | 
				
			||||||
 | 
							eingabeName.textProperty().addListener((obs, oldValue, newValue) -> {
 | 
				
			||||||
 | 
								aktualisiereListView(newValue);
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Wenn ein Eintrag in der Listeview 2x angeklickt wird, werden die entsprechenden Felder mit
 | 
				
			||||||
 | 
							//den Daten des Gerichts eingefügt
 | 
				
			||||||
 | 
							listViewVorschlag.setOnMouseClicked(event -> {
 | 
				
			||||||
 | 
								if (event.getClickCount() == 2) {
 | 
				
			||||||
 | 
									String ausgewaehlterName = listViewVorschlag.getSelectionModel().getSelectedItem();
 | 
				
			||||||
 | 
									if (ausgewaehlterName != null) {
 | 
				
			||||||
 | 
										for (Mahlzeit m : mahlzeiten) {
 | 
				
			||||||
 | 
											if (m.getName().equals(ausgewaehlterName)) {
 | 
				
			||||||
 | 
												eingabeName.setText(m.getName());
 | 
				
			||||||
 | 
												eingabePreis.setText(String.valueOf(m.getPreis()));
 | 
				
			||||||
 | 
												eingabeBeschreibung.setText(m.getBeschreibung());
 | 
				
			||||||
 | 
												break;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//wird das Fenster vergrößert, wird das Eingabefeld für Inhaltstoffe und den Hinzufügenbutton
 | 
							//wird das Fenster vergrößert, wird das Eingabefeld für Inhaltstoffe und den Hinzufügenbutton
 | 
				
			||||||
		// auf die volle breite vergrößert.
 | 
							// auf die volle breite vergrößert.
 | 
				
			||||||
@@ -40,9 +75,58 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void onButtonInhaltsstoffeClick(ActionEvent actionEvent) {
 | 
						/**
 | 
				
			||||||
 | 
						 * Holt Mahlzeiten von der API für die ListView.
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @return Liste von Mahlzeiten
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public ArrayList<Mahlzeit> getMahlzeiten() {
 | 
				
			||||||
 | 
							ArrayList<Mahlzeit> mahlzeitenListe = new ArrayList<>();
 | 
				
			||||||
 | 
							RestApiClient restApiClient = new RestApiClient();
 | 
				
			||||||
 | 
							JsonElement je = JsonParser.parseString(restApiClient.get("Gericht"));
 | 
				
			||||||
 | 
							JsonArray js = je.getAsJsonArray();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for (JsonElement element : js) {
 | 
				
			||||||
 | 
								JsonObject mahlzeitJson = element.getAsJsonObject();
 | 
				
			||||||
 | 
								String name = mahlzeitJson.get("name").getAsString();
 | 
				
			||||||
 | 
								float preis = mahlzeitJson.get("preis").getAsFloat();
 | 
				
			||||||
 | 
								String beschreibung = mahlzeitJson.get("beschreibung").getAsString();
 | 
				
			||||||
 | 
								Mahlzeit mahlzeit = new Mahlzeit(name, preis, beschreibung);
 | 
				
			||||||
 | 
								mahlzeitenListe.add(mahlzeit);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return mahlzeitenListe;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Aktualisiert die ListView je nach Eingabe in das eingabeName-Feld
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 * Getestet:
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @param eingabeGerichtFilter "Suchtext" für die Gerichte
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public void aktualisiereListView(String eingabeGerichtFilter) {
 | 
				
			||||||
 | 
							listViewVorschlag.getItems().clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (eingabeGerichtFilter == null || eingabeGerichtFilter.isEmpty()) {
 | 
				
			||||||
 | 
								for (Mahlzeit m : mahlzeiten) {
 | 
				
			||||||
 | 
									listViewVorschlag.getItems().add(m.getName());
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else {
 | 
				
			||||||
 | 
								for (Mahlzeit m : mahlzeiten) {
 | 
				
			||||||
 | 
									if (m.getName().toLowerCase().contains(eingabeGerichtFilter.toLowerCase())) {
 | 
				
			||||||
 | 
										listViewVorschlag.getItems().add(m.getName());
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void onButtonInhaltsstoffeClick() {
 | 
				
			||||||
		String text = eingabeInhaltsstoffe.getText();
 | 
							String text = eingabeInhaltsstoffe.getText();
 | 
				
			||||||
		if (!text.equals("")) {
 | 
							if (!text.isEmpty()) {
 | 
				
			||||||
			eingabeInhaltsstoffe.setText("");
 | 
								eingabeInhaltsstoffe.setText("");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Button neuerInhalt = new Button();
 | 
								Button neuerInhalt = new Button();
 | 
				
			||||||
@@ -58,37 +142,112 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Bei klick auf den Speichernbutton wird die Eingabe überprüft
 | 
				
			||||||
 | 
						 * es werden gegebenenfalls Fehlermeldungen angezeigt und es werden Mahlzeiten bei gültigen Eingaben gespeichert
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void onSpeichernButtonClick() {
 | 
						public void onSpeichernButtonClick() {
 | 
				
			||||||
		String eingabe = eingabeName.getText();
 | 
							String eingabe = eingabeName.getText();
 | 
				
			||||||
		String beschreibung = eingabeBeschreibung.getText();
 | 
							String beschreibung = eingabeBeschreibung.getText();
 | 
				
			||||||
		float preis = Float.parseFloat(eingabePreis.getText());
 | 
							StringBuilder fehlerMeldungen = new StringBuilder();
 | 
				
			||||||
		LocalDate datum = datePicker.getValue();
 | 
							boolean istGueltig = true;
 | 
				
			||||||
 | 
							float preis = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							resetFehlerrahmen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (eingabe.isEmpty()) {
 | 
				
			||||||
 | 
								eingabeName.setStyle("-fx-text-box-border: #B22222; -fx-focus-color: #B22222;");
 | 
				
			||||||
 | 
								fehlerMeldungen.append("Name eingeben. ");
 | 
				
			||||||
 | 
								istGueltig = false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (beschreibung.isEmpty()) {
 | 
				
			||||||
 | 
								eingabeBeschreibung.setStyle("-fx-text-box-border: #B22222; -fx-focus-color: #B22222;");
 | 
				
			||||||
 | 
								fehlerMeldungen.append("Beschreibung eingeben. ");
 | 
				
			||||||
 | 
								istGueltig = false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							try {
 | 
				
			||||||
 | 
								preis = Float.parseFloat(eingabePreis.getText());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							catch (NumberFormatException e) {
 | 
				
			||||||
 | 
								eingabePreis.setStyle("-fx-text-box-border: #B22222; -fx-focus-color: #B22222;");
 | 
				
			||||||
 | 
								fehlerMeldungen.append("Preis ist ungültig. ");
 | 
				
			||||||
 | 
								istGueltig = false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							LocalDate datum = datePicker.getValue();
 | 
				
			||||||
 | 
							if (datum == null) {
 | 
				
			||||||
 | 
								datePicker.setStyle("-fx-border-color: #B22222;");
 | 
				
			||||||
 | 
								fehlerMeldungen.append("Gültiges Datum eingeben. ");
 | 
				
			||||||
 | 
								istGueltig = false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (zutaten.isEmpty()) {
 | 
				
			||||||
 | 
								eingabeInhaltsstoffe.setStyle("-fx-border-color: #B22222;");
 | 
				
			||||||
 | 
								fehlerMeldungen.append("Inhaltsstoffe fehlen. ");
 | 
				
			||||||
 | 
								istGueltig = false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (!istGueltig) {
 | 
				
			||||||
 | 
								status.setText(fehlerMeldungen.toString());
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!eingabe.isEmpty() && !beschreibung.isEmpty()) {
 | 
					 | 
				
			||||||
			resetEingabeFelder();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Mahlzeit mahlzeit = new Mahlzeit(eingabe, preis, beschreibung);
 | 
							Mahlzeit mahlzeit = new Mahlzeit(eingabe, preis, beschreibung);
 | 
				
			||||||
		mahlzeiten.add(mahlzeit);
 | 
							mahlzeiten.add(mahlzeit);
 | 
				
			||||||
		status.setText("Mahlzeit hinzugefügt");
 | 
							status.setText("Mahlzeit hinzugefügt");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		int datumId = datumBearbeiten(datum);
 | 
							int datumId = datumBearbeiten(datum);
 | 
				
			||||||
			System.out.println(datumId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		int gerichtId = gerichteAbfragen(mahlzeit);
 | 
							int gerichtId = gerichteAbfragen(mahlzeit);
 | 
				
			||||||
			System.out.println(gerichtId);
 | 
							inhaltsstoff(gerichtId);
 | 
				
			||||||
 | 
					 | 
				
			||||||
			inhaltsstoff();
 | 
					 | 
				
			||||||
		gibtsAm(gerichtId, datumId);
 | 
							gibtsAm(gerichtId, datumId);
 | 
				
			||||||
 | 
							mahlzeiten.clear();
 | 
				
			||||||
 | 
							mahlzeiten = getMahlzeiten();
 | 
				
			||||||
 | 
							aktualisiereListView("");
 | 
				
			||||||
 | 
							resetEingabeFelder();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Setzt die "Fehlerrahmen" der aller Elemente zurück
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						private void resetFehlerrahmen() {
 | 
				
			||||||
 | 
							eingabeName.setStyle(null);
 | 
				
			||||||
 | 
							eingabeBeschreibung.setStyle(null);
 | 
				
			||||||
 | 
							eingabePreis.setStyle(null);
 | 
				
			||||||
 | 
							eingabeInhaltsstoffe.setStyle(null);
 | 
				
			||||||
 | 
							datePicker.setStyle(null);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Setzt alle Eingabefelder auf einen leerwert zurück
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private void resetEingabeFelder() {
 | 
						private void resetEingabeFelder() {
 | 
				
			||||||
		eingabeName.setText("");
 | 
							eingabeName.setText("");
 | 
				
			||||||
		eingabeBeschreibung.setText("");
 | 
							eingabeBeschreibung.setText("");
 | 
				
			||||||
		eingabePreis.setText("");
 | 
							eingabePreis.setText("");
 | 
				
			||||||
		eingabeInhaltsstoffe.setText("");
 | 
							eingabeInhaltsstoffe.setText("");
 | 
				
			||||||
 | 
							zutaten.clear();
 | 
				
			||||||
 | 
							anzeigeInhaltsstoffe.getChildren().clear();
 | 
				
			||||||
 | 
							datePicker.setValue(null);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Holt oder erstellt ein Datum mithilfe der API und gibt die ID zurück.
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @param datum Das eingegebene Datum
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @return ID des Datums
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	private int datumBearbeiten(LocalDate datum) {
 | 
						private int datumBearbeiten(LocalDate datum) {
 | 
				
			||||||
		RestApiClient restApiClient = new RestApiClient();
 | 
							RestApiClient restApiClient = new RestApiClient();
 | 
				
			||||||
		String datumAsString = datum.toString();
 | 
							String datumAsString = datum.toString();
 | 
				
			||||||
@@ -118,6 +277,13 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Verwendet die API, um eine Beziehung in der Datenbank zwischen Gericht und Datum herzustellen.
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @param gid ID des Gerichts
 | 
				
			||||||
 | 
						 * @param tid ID des Datums
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void gibtsAm(int gid, int tid) {
 | 
						public void gibtsAm(int gid, int tid) {
 | 
				
			||||||
		RestApiClient restApiClient = new RestApiClient();
 | 
							RestApiClient restApiClient = new RestApiClient();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -128,9 +294,15 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
		restApiClient.post("gibtsAm", gibtsAmJson.toString());
 | 
							restApiClient.post("gibtsAm", gibtsAmJson.toString());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void inhaltsstoff() {
 | 
						/**
 | 
				
			||||||
 | 
						 * Ruft Inhaltsstoffe ab und fügt sie zu einem Gericht hinzu.
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @param gerichtId ID des Gerichts
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public void inhaltsstoff(int gerichtId) {
 | 
				
			||||||
		RestApiClient restApiClient = new RestApiClient();
 | 
							RestApiClient restApiClient = new RestApiClient();
 | 
				
			||||||
		ArrayList<Integer> ids = new ArrayList<>();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (Zutat zutat : zutaten) {
 | 
							for (Zutat zutat : zutaten) {
 | 
				
			||||||
			JsonElement jE = JsonParser.parseString(restApiClient.get("Inhaltsstoff"));
 | 
								JsonElement jE = JsonParser.parseString(restApiClient.get("Inhaltsstoff"));
 | 
				
			||||||
@@ -138,32 +310,46 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			int id = -1;
 | 
								int id = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Überprüfen, ob der Inhaltsstoff bereits existiert.
 | 
				
			||||||
 | 
								// Holt Id falls er existiert
 | 
				
			||||||
			for (JsonElement element : inhaltsstoffArray) {
 | 
								for (JsonElement element : inhaltsstoffArray) {
 | 
				
			||||||
				JsonObject inhatsstoff = element.getAsJsonObject();
 | 
									JsonObject inhaltsstoff = element.getAsJsonObject();
 | 
				
			||||||
				if (inhatsstoff.get("name").getAsString().equalsIgnoreCase(zutat.getName())) {
 | 
									if (inhaltsstoff.get("name").getAsString().equalsIgnoreCase(zutat.getName())) {
 | 
				
			||||||
					id = inhatsstoff.get("id").getAsInt();
 | 
										id = inhaltsstoff.get("id").getAsInt();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Fügt Inhaltsstoff hinzu, wenn er nicht existiert
 | 
				
			||||||
			if (id == -1) {
 | 
								if (id == -1) {
 | 
				
			||||||
				JsonObject neuerInhaltsstoff = new JsonObject();
 | 
									JsonObject neuerInhaltsstoff = new JsonObject();
 | 
				
			||||||
				neuerInhaltsstoff.addProperty("name", zutat.getName());
 | 
									neuerInhaltsstoff.addProperty("name", zutat.getName());
 | 
				
			||||||
				restApiClient.post("Inhaltsstoff", neuerInhaltsstoff.toString());
 | 
									restApiClient.post("Inhaltsstoff", neuerInhaltsstoff.toString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									// Fragt Id vom neuen Inhaltsstoff ab
 | 
				
			||||||
				jE = JsonParser.parseString(restApiClient.get("Inhaltsstoff"));
 | 
									jE = JsonParser.parseString(restApiClient.get("Inhaltsstoff"));
 | 
				
			||||||
				inhaltsstoffArray = jE.getAsJsonArray();
 | 
									inhaltsstoffArray = jE.getAsJsonArray();
 | 
				
			||||||
 | 
					 | 
				
			||||||
				JsonObject letzterInhaltsstoff = inhaltsstoffArray.get(inhaltsstoffArray.size() - 1).getAsJsonObject();
 | 
									JsonObject letzterInhaltsstoff = inhaltsstoffArray.get(inhaltsstoffArray.size() - 1).getAsJsonObject();
 | 
				
			||||||
				id = letzterInhaltsstoff.get("id").getAsInt();
 | 
									id = letzterInhaltsstoff.get("id").getAsInt();
 | 
				
			||||||
				System.out.println("Inhaltsstoff hinzugefügt: " + zutat.getName());
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			ids.add(id);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		System.out.println("IDs der Inhaltsstoffe: " + ids);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// Stellt verknüpfung zur Enthälttabelle her
 | 
				
			||||||
 | 
								JsonObject enthaelt = new JsonObject();
 | 
				
			||||||
 | 
								enthaelt.addProperty("iid", id);
 | 
				
			||||||
 | 
								enthaelt.addProperty("gid", gerichtId);
 | 
				
			||||||
 | 
								restApiClient.post("Enthaelt", enthaelt.toString());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Prüft, ob ein Gericht bereits existiert, wenn es nicht existiert wird es hinzugefügt.
 | 
				
			||||||
 | 
						 * Falls es existiert wird Preis und Beschreibung aktualisiert.
 | 
				
			||||||
 | 
						 * Geschrieben: Stefan Groß
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @param mahlzeit Die zu überprüfende oder hinzuzufügende Mahlzeit
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * @return ID des Gerichts
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private int gerichteAbfragen(Mahlzeit mahlzeit) {
 | 
						private int gerichteAbfragen(Mahlzeit mahlzeit) {
 | 
				
			||||||
		RestApiClient restApiClient = new RestApiClient();
 | 
							RestApiClient restApiClient = new RestApiClient();
 | 
				
			||||||
@@ -197,7 +383,7 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		restApiClient.post("Gericht", neuesGericht.toString());
 | 
							restApiClient.post("Gericht", neuesGericht.toString());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// ID des neu hinzugefügten Gerichts abrufen
 | 
							// ID des Gerichts abrufen
 | 
				
			||||||
		je = JsonParser.parseString(restApiClient.get("Gericht"));
 | 
							je = JsonParser.parseString(restApiClient.get("Gericht"));
 | 
				
			||||||
		js = je.getAsJsonArray();
 | 
							js = je.getAsJsonArray();
 | 
				
			||||||
		for (JsonElement element : js) {
 | 
							for (JsonElement element : js) {
 | 
				
			||||||
@@ -208,4 +394,5 @@ public class GerichterstellungMitarbeiterView {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -9,6 +9,7 @@ import javafx.scene.layout.GridPane;
 | 
				
			|||||||
import javafx.scene.text.TextAlignment;
 | 
					import javafx.scene.text.TextAlignment;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.text.DateFormat;
 | 
					import java.text.DateFormat;
 | 
				
			||||||
 | 
					import java.time.LocalDate;
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class HauptmenueMitarbeiterView {
 | 
					public class HauptmenueMitarbeiterView {
 | 
				
			||||||
@@ -34,14 +35,8 @@ public class HauptmenueMitarbeiterView {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public void wochenuebersichtFuellen(){
 | 
					    public void wochenuebersichtFuellen(){
 | 
				
			||||||
        String dateanzeige;
 | 
					        String dateanzeige;
 | 
				
			||||||
        DateFormat dateFormat = DateFormat.getDateInstance();
 | 
					        date = LocalDate.now().toString();
 | 
				
			||||||
        date = dateFormat.format(new Date());
 | 
					        dateanzeige = date;
 | 
				
			||||||
        date = date.replace('.', '-');
 | 
					 | 
				
			||||||
        day = date.split("-")[0];
 | 
					 | 
				
			||||||
        month = date.split("-")[1];
 | 
					 | 
				
			||||||
        year = date.split("-")[2];
 | 
					 | 
				
			||||||
        date = String.format("%s-%s-%s", year, month, day);
 | 
					 | 
				
			||||||
        dateanzeige = String.format("%s.%s.%s",day,month,year);
 | 
					 | 
				
			||||||
        Tagesplan t = new RestApiClient().getGerichteOnTag(date);
 | 
					        Tagesplan t = new RestApiClient().getGerichteOnTag(date);
 | 
				
			||||||
        for(int i=0;i<5;i++){
 | 
					        for(int i=0;i<5;i++){
 | 
				
			||||||
            Label tag = new Label();
 | 
					            Label tag = new Label();
 | 
				
			||||||
@@ -55,13 +50,19 @@ public class HauptmenueMitarbeiterView {
 | 
				
			|||||||
                name.setPrefHeight(75);
 | 
					                name.setPrefHeight(75);
 | 
				
			||||||
                name.setTextAlignment(TextAlignment.CENTER);
 | 
					                name.setTextAlignment(TextAlignment.CENTER);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            day = String.valueOf(Integer.parseInt(day)+1);
 | 
					            LocalDate datum = LocalDate.parse(date);
 | 
				
			||||||
            date = String.format("%s-%s-%s", year, month, day);
 | 
					            datum = datum.plusDays(1);
 | 
				
			||||||
            dateanzeige = String.format("%s.%s.%s",day,month,year);
 | 
					            date = datum.toString();
 | 
				
			||||||
 | 
					            dateanzeige = date;
 | 
				
			||||||
            t = new RestApiClient().getGerichteOnTag(date);
 | 
					            t = new RestApiClient().getGerichteOnTag(date);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Methode beim klicken auf den Anmeldebutton. Meldet den User ab
 | 
				
			||||||
 | 
					     * @param actionEvent
 | 
				
			||||||
 | 
					     * @author Samuel Wolff
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public void onAbmelden(ActionEvent actionEvent) {
 | 
					    public void onAbmelden(ActionEvent actionEvent) {
 | 
				
			||||||
        VerwaltungApplication.abmelden();
 | 
					        VerwaltungApplication.abmelden();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,25 +31,27 @@ public class InhaltsstoffeFilternController {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private ArrayList<Zutat> zutaten;
 | 
						private ArrayList<Zutat> zutaten;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Initialisert sie InhaltsstoffeFiltern View
 | 
				
			||||||
 | 
						 * @author Sven Alteköster
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
	public void initialize(){
 | 
						public void initialize(){
 | 
				
			||||||
 | 
							//mehrere Inhaltsstoffe können ausgewählt werden
 | 
				
			||||||
		zutatListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
 | 
							zutatListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Befüllen der ListView mit allen existierenden Inhaltsstoffen
 | 
				
			||||||
		RestApiClient api = new RestApiClient();
 | 
							RestApiClient api = new RestApiClient();
 | 
				
			||||||
		String json = api.get("Inhaltsstoff");
 | 
							String json = api.get("Inhaltsstoff");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		zutaten = new ArrayList<>();
 | 
							zutaten = new ArrayList<>();
 | 
				
			||||||
 | 
					 | 
				
			||||||
		Gson gson = new Gson();
 | 
							Gson gson = new Gson();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		JsonElement je = JsonParser.parseString(json);
 | 
							JsonElement je = JsonParser.parseString(json);
 | 
				
			||||||
		JsonArray ja = je.getAsJsonArray();
 | 
							JsonArray ja = je.getAsJsonArray();
 | 
				
			||||||
 | 
					 | 
				
			||||||
		for (JsonElement e : ja) {
 | 
							for (JsonElement e : ja) {
 | 
				
			||||||
			JsonObject jo = e.getAsJsonObject();
 | 
								JsonObject jo = e.getAsJsonObject();
 | 
				
			||||||
			zutaten.add(gson.fromJson(jo, Zutat.class));
 | 
								zutaten.add(gson.fromJson(jo, Zutat.class));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					 | 
				
			||||||
		zutatListView.setItems(FXCollections.observableArrayList(zutaten));
 | 
							zutatListView.setItems(FXCollections.observableArrayList(zutaten));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								src/main/java/de/subway_surfers/vpr_app/Main.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/main/java/de/subway_surfers/vpr_app/Main.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					package de.subway_surfers.vpr_app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class Main {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public static void main(String[] args) {
 | 
				
			||||||
 | 
							VerwaltungApplication.main(args);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -21,7 +21,7 @@ public class VerwaltungApplication extends Application {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public void start(Stage stage) throws IOException {
 | 
						public void start(Stage stage) throws IOException {
 | 
				
			||||||
		FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("gerichterstellung_mitarbeiter-view.fxml"));
 | 
							FXMLLoader fxmlLoader = new FXMLLoader(VerwaltungApplication.class.getResource("login-view.fxml"));
 | 
				
			||||||
		Scene scene = new Scene(fxmlLoader.load());
 | 
							Scene scene = new Scene(fxmlLoader.load());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		stage.setWidth(960);
 | 
							stage.setWidth(960);
 | 
				
			||||||
@@ -48,7 +48,6 @@ public class VerwaltungApplication extends Application {
 | 
				
			|||||||
	 * Die Scene auf der aktuellen Stage wird durch die in der fxml-Datei definierte Scene ausgetauscht.
 | 
						 * Die Scene auf der aktuellen Stage wird durch die in der fxml-Datei definierte Scene ausgetauscht.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * Geschrieben: Sven Alteköster
 | 
						 * Geschrieben: Sven Alteköster
 | 
				
			||||||
	 * Getestet:
 | 
					 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param fxml name der zu ladenden fxml Datei.
 | 
						 * @param fxml name der zu ladenden fxml Datei.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
@@ -84,9 +83,7 @@ public class VerwaltungApplication extends Application {
 | 
				
			|||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * in einem neuen Fenster wird die in der fxml-Datei definierte Scene gesetzt.
 | 
						 * in einem neuen Fenster wird die in der fxml-Datei definierte Scene gesetzt.
 | 
				
			||||||
	 * Die geladene Scene wird <b><u>nicht</u></b> zu der neuen Hauptstage.
 | 
						 * Die geladene Scene wird <b><u>nicht</u></b> zu der neuen Hauptstage.
 | 
				
			||||||
	 *
 | 
					 | 
				
			||||||
	 * Geschrieben: Sven Alteköster
 | 
						 * Geschrieben: Sven Alteköster
 | 
				
			||||||
	 * Getestet:
 | 
					 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param neue Stage auf der die Scene gesetzt werden soll
 | 
						 * @param neue Stage auf der die Scene gesetzt werden soll
 | 
				
			||||||
	 * @param width breite des neuen Fensters
 | 
						 * @param width breite des neuen Fensters
 | 
				
			||||||
@@ -121,7 +118,6 @@ public class VerwaltungApplication extends Application {
 | 
				
			|||||||
	 * Methode zum automatischen vergrößern und verkleinern von Grids
 | 
						 * Methode zum automatischen vergrößern und verkleinern von Grids
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * Geschrieben: Max Heer, Sven Alteköster
 | 
						 * Geschrieben: Max Heer, Sven Alteköster
 | 
				
			||||||
	 * Getestet
 | 
					 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param grid das responsiv sein soll
 | 
						 * @param grid das responsiv sein soll
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,44 +0,0 @@
 | 
				
			|||||||
package de.subway_surfers.vpr_app.logik;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import Logik.Zutat;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import java.util.ArrayList;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public class Kind {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	private String           name;
 | 
					 | 
				
			||||||
	private String           vorname;
 | 
					 | 
				
			||||||
	private int              id;
 | 
					 | 
				
			||||||
	private ArrayList<Zutat> filter;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public Kind(String name, String vorname, int id) {
 | 
					 | 
				
			||||||
		ArrayList<Zutat> filter = new ArrayList<>();
 | 
					 | 
				
			||||||
		this.name    = name;
 | 
					 | 
				
			||||||
		this.vorname = vorname;
 | 
					 | 
				
			||||||
		this.id      = id;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public String getName() {
 | 
					 | 
				
			||||||
		return name;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void setName(String name) {
 | 
					 | 
				
			||||||
		this.name = name;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public String getVorname() {
 | 
					 | 
				
			||||||
		return vorname;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public void setVorname(String vorname) {
 | 
					 | 
				
			||||||
		this.vorname = vorname;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public int getId() {
 | 
					 | 
				
			||||||
		return id;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	public ArrayList<Zutat> getFilter() {
 | 
					 | 
				
			||||||
		return filter;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -6,6 +6,8 @@
 | 
				
			|||||||
<?import javafx.scene.control.*?>
 | 
					<?import javafx.scene.control.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Erstellt von Sven Alteköster -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<BorderPane xmlns="http://javafx.com/javafx"
 | 
					<BorderPane xmlns="http://javafx.com/javafx"
 | 
				
			||||||
            xmlns:fx="http://javafx.com/fxml"
 | 
					            xmlns:fx="http://javafx.com/fxml"
 | 
				
			||||||
            fx:controller="de.subway_surfers.vpr_app.AccounterstellungMitarbeiter"
 | 
					            fx:controller="de.subway_surfers.vpr_app.AccounterstellungMitarbeiter"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,9 +52,6 @@
 | 
				
			|||||||
    </center>
 | 
					    </center>
 | 
				
			||||||
    <bottom>
 | 
					    <bottom>
 | 
				
			||||||
        <BorderPane styleClass="button-untenrechts">
 | 
					        <BorderPane styleClass="button-untenrechts">
 | 
				
			||||||
            <right>
 | 
					 | 
				
			||||||
                <Button text="Bestätigen" defaultButton="true" styleClass=".button"/>
 | 
					 | 
				
			||||||
            </right>
 | 
					 | 
				
			||||||
        </BorderPane>
 | 
					        </BorderPane>
 | 
				
			||||||
    </bottom>
 | 
					    </bottom>
 | 
				
			||||||
</BorderPane>
 | 
					</BorderPane>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,8 @@
 | 
				
			|||||||
<?import javafx.scene.control.*?>
 | 
					<?import javafx.scene.control.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Erstellt von Sven Alteköster -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<?import javafx.geometry.Insets?>
 | 
					<?import javafx.geometry.Insets?>
 | 
				
			||||||
<BorderPane xmlns="http://javafx.com/javafx"
 | 
					<BorderPane xmlns="http://javafx.com/javafx"
 | 
				
			||||||
            xmlns:fx="http://javafx.com/fxml"
 | 
					            xmlns:fx="http://javafx.com/fxml"
 | 
				
			||||||
@@ -16,7 +18,8 @@
 | 
				
			|||||||
       <VBox styleClass="gerichterstellung_felder">
 | 
					       <VBox styleClass="gerichterstellung_felder">
 | 
				
			||||||
           <TextField fx:id="eingabeName" promptText="Name des Gerichtes" focusTraversable="false"/>
 | 
					           <TextField fx:id="eingabeName" promptText="Name des Gerichtes" focusTraversable="false"/>
 | 
				
			||||||
           <TextField fx:id="eingabePreis" promptText="Preis des Gerichtes" focusTraversable="false"/>
 | 
					           <TextField fx:id="eingabePreis" promptText="Preis des Gerichtes" focusTraversable="false"/>
 | 
				
			||||||
           <TextArea fx:id="eingabeBeschreibung" promptText="Beschreibung" focusTraversable="false"/>
 | 
					           <ListView fx:id="listViewVorschlag" focusTraversable="false" minHeight="200" maxHeight="250"/>
 | 
				
			||||||
 | 
					           <TextArea fx:id="eingabeBeschreibung" promptText="Beschreibung" focusTraversable="false" minHeight="75"/>
 | 
				
			||||||
           <HBox>
 | 
					           <HBox>
 | 
				
			||||||
               <TextField fx:id="eingabeInhaltsstoffe" promptText="Inhaltsstoffe" focusTraversable="false"/>
 | 
					               <TextField fx:id="eingabeInhaltsstoffe" promptText="Inhaltsstoffe" focusTraversable="false"/>
 | 
				
			||||||
               <Button fx:id="buttonInhaltsstoffe" onAction="#onButtonInhaltsstoffeClick" text="Hinzufügen"/>
 | 
					               <Button fx:id="buttonInhaltsstoffe" onAction="#onButtonInhaltsstoffeClick" text="Hinzufügen"/>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,8 @@
 | 
				
			|||||||
<?import javafx.scene.control.*?>
 | 
					<?import javafx.scene.control.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Erstellt von Sven Alteköster -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<BorderPane xmlns="http://javafx.com/javafx"
 | 
					<BorderPane xmlns="http://javafx.com/javafx"
 | 
				
			||||||
            xmlns:fx="http://javafx.com/fxml"
 | 
					            xmlns:fx="http://javafx.com/fxml"
 | 
				
			||||||
            fx:controller="de.subway_surfers.vpr_app.HauptmenueElternController"
 | 
					            fx:controller="de.subway_surfers.vpr_app.HauptmenueElternController"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,8 +25,6 @@
 | 
				
			|||||||
                <VBox styleClass="hauptmenue_buttons_links">
 | 
					                <VBox styleClass="hauptmenue_buttons_links">
 | 
				
			||||||
                    <Button text="Speiseplan" onAction="#onSpeiseplanClick"/>
 | 
					                    <Button text="Speiseplan" onAction="#onSpeiseplanClick"/>
 | 
				
			||||||
                    <Button text="Alle Bestellungen anzeigen" onAction="#onBestellungenAnzeigen"/>
 | 
					                    <Button text="Alle Bestellungen anzeigen" onAction="#onBestellungenAnzeigen"/>
 | 
				
			||||||
                    <Button text="Rechnungen herunterladen"/>
 | 
					 | 
				
			||||||
                    <Button text="Daten importieren/Exportieren"/>
 | 
					 | 
				
			||||||
                    <Button text="Account anlegen" onAction="#onAccountAnlegenClick"/>
 | 
					                    <Button text="Account anlegen" onAction="#onAccountAnlegenClick"/>
 | 
				
			||||||
                </VBox>
 | 
					                </VBox>
 | 
				
			||||||
            </left>
 | 
					            </left>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,8 @@
 | 
				
			|||||||
<?import javafx.scene.control.*?>
 | 
					<?import javafx.scene.control.*?>
 | 
				
			||||||
<?import javafx.scene.layout.*?>
 | 
					<?import javafx.scene.layout.*?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- Erstellt von Sven Alteköster -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<BorderPane xmlns="http://javafx.com/javafx"
 | 
					<BorderPane xmlns="http://javafx.com/javafx"
 | 
				
			||||||
            xmlns:fx="http://javafx.com/fxml"
 | 
					            xmlns:fx="http://javafx.com/fxml"
 | 
				
			||||||
            fx:controller="de.subway_surfers.vpr_app.VerwaltungController"
 | 
					            fx:controller="de.subway_surfers.vpr_app.VerwaltungController"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user