aus main stuff kopiert

This commit is contained in:
2023-01-31 17:51:37 +01:00
parent 2814244d29
commit f09d63dd21
3 changed files with 109 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
/*Reshad Meher*/
package com.bib.essensbestellungsverwaltung;
import javafx.fxml.FXML;
@@ -15,6 +14,7 @@ import java.util.HashMap;
public class LoginController {
@FXML
private TextField tfEmail;
@FXML
private PasswordField pfPassword;
@@ -25,20 +25,18 @@ public class LoginController {
String email = tfEmail.getText();
String password = pfPassword.getText();
if(benutzerMap.containsKey(email) && benutzerMap.containsValue(password)){
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("menue-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 950,480);
HelloApplication.primary.setScene(scene);
// if user is worker: StartViewApplication.changeScene("workerMenu-view.fxml");
StartViewApplication.changeScene("parentMenu-view.fxml");
}else {
Alert alert = new Alert(Alert.AlertType.ERROR,"Email oder Passwort ist falsch");
alert.showAndWait();
}
tfEmail.setText("");
pfPassword.setText("");
}
@FXML
protected void changeToSignUp() throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("signUp-view.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 950,480);
HelloApplication.primary.setScene(scene);
StartViewApplication.changeScene("signUp-view.fxml");
}
}