From main:

Reshad Meher:
sanitized 7932c7e896
This commit is contained in:
Malte Schulze Hobeling 2023-02-05 21:19:21 +01:00
parent 13bc9ae1dd
commit 6fc28a0827
2 changed files with 38 additions and 38 deletions

View File

@ -12,55 +12,55 @@ import java.io.IOException;
public class SingUpController {
@FXML
private TextField tfName;
private TextField tfLastName;
@FXML
private TextField tfVorname;
private TextField tfFirstName;
@FXML
private TextField tfEmail;
@FXML
private PasswordField pfPasswort;
private PasswordField pfPassword;
@FXML
private TextField tfPLZ;
private TextField tfPostCode;
@FXML
private TextField tfStadt;
private TextField tfCity;
@FXML
private TextField tfStrasse;
private TextField tfStreet;
@FXML
private TextField tfHausnummer;
private TextField tfHouseNumber;
@FXML
private void onKontoErstellenBtClick(){
String name = tfName.getText();
String vorname = tfVorname.getText();
String lastName = tfLastName.getText();
String firstName = tfFirstName.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();
String password = pfPassword.getText();
String postCode = tfPostCode.getText();
String city = tfCity.getText();
String street = tfStreet.getText();
String houseNumber = tfHouseNumber.getText();
Alert alert;
if(name.isEmpty() || vorname.isEmpty() || email.isEmpty() || passwort.isEmpty() || plz.isEmpty() ||
stadt.isEmpty() || strasse.isEmpty() || hausnummer.isEmpty()){
if(lastName.isEmpty() || firstName.isEmpty() || email.isEmpty() || password.isEmpty() || postCode.isEmpty() ||
city.isEmpty() || street.isEmpty() || houseNumber.isEmpty()){
if(name.isEmpty()){
if(lastName.isEmpty()){
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Name' ist leer.");
alert.showAndWait();
} else if (vorname.isEmpty()) {
} else if (firstName.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()) {
} else if (password.isEmpty()) {
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Passwort' ist leer.");
alert.showAndWait();
} else if (plz.isEmpty()) {
} else if (postCode.isEmpty()) {
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Postleitzahl' ist leer.");
alert.showAndWait();
} else if (stadt.isEmpty()) {
} else if (city.isEmpty()) {
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Stadt' ist leer.");
alert.showAndWait();
} else if (strasse.isEmpty()) {
} else if (street.isEmpty()) {
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Straße' ist leer.");
alert.showAndWait();
}else {
@ -69,8 +69,8 @@ public class SingUpController {
}
}else {
Address newAdresse = new Address(strasse,hausnummer,plz,stadt);
User newUser = new User(name,vorname,passwort,email,newAdresse);
Address newAdresse = new Address(street,houseNumber,postCode,city);
User newUser = new User(lastName,firstName,password,email,newAdresse);
if(StartViewApplication.firstLaunch){
long id = AccountMgr.createWorker(new Worker(newUser));
if(id < 1) {
@ -91,14 +91,14 @@ public class SingUpController {
alert = new Alert(Alert.AlertType.CONFIRMATION,"Eltern Account erfolgreich erstellt");
alert.showAndWait();
}
tfName.setText("");
tfVorname.setText("");
tfLastName.setText("");
tfFirstName.setText("");
tfEmail.setText("");
pfPasswort.setText("");
tfPLZ.setText("");
tfStadt.setText("");
tfStrasse.setText("");
tfHausnummer.setText("");
pfPassword.setText("");
tfPostCode.setText("");
tfCity.setText("");
tfStreet.setText("");
tfHouseNumber.setText("");
}
}

View File

@ -31,7 +31,7 @@
<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;">
<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;">
<TextField fx:id="tfLastName" 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>
@ -42,7 +42,7 @@
<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;">
<TextField fx:id="tfFirstName" promptText="Vorname" style="-fx-background-color: transparent; -fx-border-color: lightgray; -fx-border-width: 0 0 1 0;">
<effect>
<Blend />
</effect>
@ -64,7 +64,7 @@
<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;">
<PasswordField fx:id="pfPassword" 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>
@ -80,7 +80,7 @@
</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;">
<TextField fx:id="tfPostCode" 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>
@ -88,7 +88,7 @@
<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;">
<TextField fx:id="tfCity" 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>
@ -100,7 +100,7 @@
</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;">
<TextField fx:id="tfStreet" 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>
@ -108,7 +108,7 @@
<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;">
<TextField fx:id="tfHouseNumber" 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>