| @@ -8,7 +8,6 @@ import javafx.scene.control.TextField; | ||||
| import javafx.scene.text.Text; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
|  | ||||
| public class CreateFoodController { | ||||
| @@ -37,7 +36,7 @@ public class CreateFoodController { | ||||
|     } | ||||
|  | ||||
|     @FXML | ||||
|     public void onHinzufügen(ActionEvent actionEvent) { | ||||
|     public void onHinzufuegen(ActionEvent actionEvent) { | ||||
|         String gerichtName = name.getText(); | ||||
|         String beschreibung = description.getText(); | ||||
|         if(!isHauptgerichtRadio.isSelected() && !isDessertRadio.isSelected()){ | ||||
|   | ||||
| @@ -5,11 +5,12 @@ import javafx.scene.control.Alert; | ||||
| import javafx.scene.control.Label; | ||||
| import javafx.scene.control.TextField; | ||||
|  | ||||
| /** | ||||
|  * @author Reshad Meher | ||||
|  * Username, Passwort , login | ||||
|  */ | ||||
|  | ||||
| public class HelloController { | ||||
|     /** | ||||
|      * @autor: Reshad Meher | ||||
|      * Username, Passwort , login | ||||
|      */ | ||||
|  | ||||
|     @FXML | ||||
|     private TextField unsernameEingabe; | ||||
|   | ||||
| @@ -1,11 +1,100 @@ | ||||
| /** | ||||
|  * @autor: Reshad Meher | ||||
|  */ | ||||
| package com.bib.essensbestellungsverwaltung; | ||||
|  | ||||
| import javafx.event.ActionEvent; | ||||
| import javafx.fxml.FXML; | ||||
| import javafx.fxml.FXMLLoader; | ||||
| import javafx.scene.Scene; | ||||
| import javafx.scene.control.Alert; | ||||
| import javafx.scene.control.PasswordField; | ||||
| import javafx.scene.control.TextField; | ||||
|  | ||||
| import java.io.IOException; | ||||
| import java.util.HashMap; | ||||
|  | ||||
| public class SingUpController { | ||||
|     public void onKontoErstellenBtClick(ActionEvent actionEvent) { | ||||
|     @FXML | ||||
|     private TextField tfName; | ||||
|     @FXML | ||||
|     private TextField tfVorname; | ||||
|     @FXML | ||||
|     private TextField tfEmail; | ||||
|     @FXML | ||||
|     private PasswordField pfPasswort; | ||||
|     @FXML | ||||
|     private TextField tfPLZ; | ||||
|     @FXML | ||||
|     private TextField tfStadt; | ||||
|  | ||||
|     @FXML | ||||
|     private TextField tfStrasse; | ||||
|     @FXML | ||||
|     private TextField tfHausnummer; | ||||
|     @FXML | ||||
|     private void onKontoErstellenBtClick(){ | ||||
|         String name = tfName.getText(); | ||||
|         String vorname = tfVorname.getText(); | ||||
|         String email = tfEmail.getText(); | ||||
|         String passwort = pfPasswort.getText(); | ||||
|         String plz = tfPLZ.getText(); | ||||
|         String stadt = tfStadt.getText(); | ||||
|         String strasse = tfStrasse.getText(); | ||||
|         String hausnummer = tfHausnummer.getText(); | ||||
|         Alert alert; | ||||
|         if(name.isEmpty() || vorname.isEmpty() || email.isEmpty() || passwort.isEmpty() || plz.isEmpty() || | ||||
|                 stadt.isEmpty() || strasse.isEmpty() || hausnummer.isEmpty()){ | ||||
|  | ||||
|             if(name.isEmpty()){ | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Name'  ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (vorname.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld  'Vorname' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (email.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'E-Mail' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (passwort.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Passwort' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (plz.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Postleitzahl' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (stadt.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Stadt' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } else if (strasse.isEmpty()) { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld  'Straße' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             }else { | ||||
|                 alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld  'Hausnummer' ist leer."); | ||||
|                 alert.showAndWait(); | ||||
|             } | ||||
|  | ||||
|         }else { | ||||
|             Address newAdresse = new Address(strasse,hausnummer,plz,stadt); | ||||
|             User newUser = new User(name,vorname,passwort,email,newAdresse); | ||||
|             long creatNewUser = AccountMgr.createUser(newUser); | ||||
|             if (creatNewUser > 0){ | ||||
|                 alert = new Alert(Alert.AlertType.CONFIRMATION,"Ihrer Daten wurde gespeichert."); | ||||
|                 alert.showAndWait(); | ||||
|             } | ||||
|             tfName.setText(""); | ||||
|             tfVorname.setText(""); | ||||
|             tfEmail.setText(""); | ||||
|             pfPasswort.setText(""); | ||||
|             tfPLZ.setText(""); | ||||
|             tfStadt.setText(""); | ||||
|             tfStrasse.setText(""); | ||||
|             tfHausnummer.setText(""); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public void onAnmeldenBtClick(ActionEvent actionEvent) { | ||||
|     @FXML | ||||
|     private void onAnmeldenBtClick() throws IOException { | ||||
|         FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml")); | ||||
|         Scene scene = new Scene(fxmlLoader.load(), 950,480); | ||||
|         StartViewApplication.primary.setScene(scene); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user