Compare commits
No commits in common. "0b02c1c6615da4e3e400c78f6999c49ca591a711" and "0d36d7718efd5b4691d2cff0cb7ee7b4ab331056" have entirely different histories.
0b02c1c661
...
0d36d7718e
@ -0,0 +1,34 @@
|
||||
package com.bib.essensbestellungsverwaltung;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class HelloController {
|
||||
/**
|
||||
* @autor: Reshad Meher
|
||||
* Username, Passwort , login
|
||||
*/
|
||||
|
||||
@FXML
|
||||
private TextField unsernameEingabe;
|
||||
@FXML
|
||||
private TextField passwortEingabe;
|
||||
@FXML
|
||||
private Label lblAusgabe;
|
||||
@FXML
|
||||
protected void onLoginButtonClick() {
|
||||
String benutzerEingabe = unsernameEingabe.getText();
|
||||
String kennwortEingabe = passwortEingabe.getText();
|
||||
if(benutzerEingabe.contains("Reshad") && kennwortEingabe.contains("test123")){
|
||||
lblAusgabe.setText("Herzlich Willkommen, " + benutzerEingabe + "!");
|
||||
}else {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR,
|
||||
"Die Benutzername oder Passwort ist falsch");
|
||||
alert.showAndWait();
|
||||
}
|
||||
unsernameEingabe.setText("");
|
||||
passwortEingabe.setText("");
|
||||
}
|
||||
}
|
@ -26,12 +26,8 @@ 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);
|
||||
Stage stage = new Stage();
|
||||
stage.setTitle("Essen Bestellung im Kindergarten");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
// 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();
|
||||
@ -42,12 +38,6 @@ public class LoginController {
|
||||
}
|
||||
@FXML
|
||||
protected void changeToSignUp() throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("signUp-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 950,480);
|
||||
Stage stage = new Stage();
|
||||
stage.setTitle("Essen Bestellung im Kindergarten");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
|
||||
StartViewApplication.changeScene("signUp-view.fxml");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.bib.essensbestellungsverwaltung;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SceneController {
|
||||
|
||||
}
|
@ -1,100 +1,11 @@
|
||||
/**
|
||||
* @autor: Reshad Meher
|
||||
*/
|
||||
package com.bib.essensbestellungsverwaltung;
|
||||
|
||||
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;
|
||||
import javafx.event.ActionEvent;
|
||||
|
||||
public class SingUpController {
|
||||
@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 onKontoErstellenBtClick(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);
|
||||
public void onAnmeldenBtClick(ActionEvent actionEvent) {
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
package com.bib.essensbestellungsverwaltung;
|
||||
|
||||
public class StartPageController {
|
||||
}
|
@ -7,6 +7,7 @@ package com.bib.essensbestellungsverwaltung;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
@ -14,14 +15,17 @@ import java.io.IOException;
|
||||
|
||||
public class StartViewApplication extends Application {
|
||||
public static Stage primary;
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(StartViewApplication.class.getResource("login-view.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load(), 950,480);
|
||||
Scene scene = new Scene(fxmlLoader.load(), 1300, 750);
|
||||
primary = stage;
|
||||
stage.setTitle("Essen Bestellung im Kindergarten");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
@ -32,4 +36,9 @@ public class StartViewApplication extends Application {
|
||||
//Database.deleteSample();
|
||||
launch();
|
||||
}
|
||||
|
||||
public static void changeScene(String scene) throws IOException {
|
||||
Parent p = FXMLLoader.load(StartViewApplication.class.getResource(scene));
|
||||
primary.getScene().setRoot(p);
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font></Button>
|
||||
<Button id="btSignUp" mnemonicParsing="false" prefHeight="25.0" prefWidth="101.0" style="-fx-background-color: tranparent;" text="Sign up" textFill="#7c7b7b" underline="true" onAction="#onBtSingnupClick" />
|
||||
<Button id="btSignUp" mnemonicParsing="false" prefHeight="25.0" prefWidth="101.0" style="-fx-background-color: tranparent;" text="Sign up" textFill="#7c7b7b" underline="true" onAction="#changeToSignUp" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
|
@ -29,109 +29,72 @@
|
||||
<Circle fill="#67b5ff2e" layoutX="-23.0" layoutY="368.0" radius="100.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" />
|
||||
<Circle fill="#69b6ffb0" layoutX="235.0" layoutY="310.0" radius="158.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" />
|
||||
<Circle fill="#93c4f23d" layoutY="258.0" radius="106.0" stroke="BLACK" strokeType="INSIDE" strokeWidth="0.0" />
|
||||
<VBox layoutX="262.0" prefHeight="400.0" prefWidth="364.0" style="-fx-background-color: white;">
|
||||
<VBox alignment="CENTER" layoutX="263.0" prefHeight="400.0" prefWidth="338.0" style="-fx-background-color: white;">
|
||||
<children>
|
||||
<TextField fx:id="tfName" alignment="TOP_LEFT" prefHeight="26.0" prefWidth="282.0" promptText="Name" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="tfVorname" promptText="Vorname" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="tfEmail" promptText="Email" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<PasswordField fx:id="pfPasswort" accessibleRole="TEXT_FIELD" promptText="Passwort" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</PasswordField>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<TextField fx:id="tfPLZ" prefHeight="35.0" prefWidth="92.0" promptText="PLZ" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<HBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</HBox.margin>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
</TextField>
|
||||
<TextField fx:id="tfStadt" prefHeight="35.0" prefWidth="182.0" promptText="Stadt" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<HBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</HBox.margin>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
</TextField>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<TextField fx:id="tfStrasse" prefHeight="27.0" prefWidth="134.0" promptText="Straße" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<HBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</HBox.margin>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
</TextField>
|
||||
<TextField fx:id="tfHausnummer" prefHeight="27.0" prefWidth="99.0" promptText="Hausnummer" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
|
||||
<HBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</HBox.margin>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
</TextField>
|
||||
</children>
|
||||
</HBox>
|
||||
<TextField promptText="Email" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;" fx:id="tfEmail">
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField promptText="Email bestätigen" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;" fx:id="tfBestätigungEmail">
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<PasswordField promptText="Passwort" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;" fx:id="pfPasswort">
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</PasswordField>
|
||||
<PasswordField promptText="Passwort bestätigen" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;" fx:id="pfBestätigungPassowrt">
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
<effect>
|
||||
<Blend />
|
||||
</effect>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</PasswordField>
|
||||
<HBox alignment="CENTER" prefHeight="30.0" prefWidth="238.0">
|
||||
<children>
|
||||
<Button mnemonicParsing="false" onAction="#onKontoErstellenBtClick" prefHeight="25.0" prefWidth="106.0" style="-fx-background-radius: 25; -fx-background-color: lightblue;" text="Konto erstellen" textFill="WHITE">
|
||||
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="106.0" style="-fx-background-radius: 25; -fx-background-color: lightblue;" text="Konto erstellen" textFill="WHITE" onAction="#onKontoErstellenBtClick">
|
||||
<font>
|
||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||
</font></Button>
|
||||
<Button id="btSignUp" mnemonicParsing="false" onAction="#onAnmeldenBtClick" prefHeight="25.0" prefWidth="101.0" style="-fx-background-color: tranparent;" text="Anmelden" textFill="#7c7b7b" underline="true" />
|
||||
<Button id="btSignUp" mnemonicParsing="false" prefHeight="25.0" prefWidth="101.0" style="-fx-background-color: tranparent;" text="Anmelden" textFill="#7c7b7b" underline="true" onAction="#onAnmeldenBtClick"/>
|
||||
</children>
|
||||
<opaqueInsets>
|
||||
<Insets top="15.0" />
|
||||
</opaqueInsets>
|
||||
<VBox.margin>
|
||||
<Insets top="15.0" />
|
||||
</VBox.margin>
|
||||
<opaqueInsets>
|
||||
<Insets top="15.0" />
|
||||
</opaqueInsets>
|
||||
<VBox.margin>
|
||||
<Insets top="15.0" />
|
||||
</VBox.margin>
|
||||
</HBox>
|
||||
</children>
|
||||
<padding>
|
||||
|
Loading…
Reference in New Issue
Block a user