parent
13bc9ae1dd
commit
6fc28a0827
@ -12,55 +12,55 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class SingUpController {
|
public class SingUpController {
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfName;
|
private TextField tfLastName;
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfVorname;
|
private TextField tfFirstName;
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfEmail;
|
private TextField tfEmail;
|
||||||
@FXML
|
@FXML
|
||||||
private PasswordField pfPasswort;
|
private PasswordField pfPassword;
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfPLZ;
|
private TextField tfPostCode;
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfStadt;
|
private TextField tfCity;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfStrasse;
|
private TextField tfStreet;
|
||||||
@FXML
|
@FXML
|
||||||
private TextField tfHausnummer;
|
private TextField tfHouseNumber;
|
||||||
@FXML
|
@FXML
|
||||||
private void onKontoErstellenBtClick(){
|
private void onKontoErstellenBtClick(){
|
||||||
String name = tfName.getText();
|
String lastName = tfLastName.getText();
|
||||||
String vorname = tfVorname.getText();
|
String firstName = tfFirstName.getText();
|
||||||
String email = tfEmail.getText();
|
String email = tfEmail.getText();
|
||||||
String passwort = pfPasswort.getText();
|
String password = pfPassword.getText();
|
||||||
String plz = tfPLZ.getText();
|
String postCode = tfPostCode.getText();
|
||||||
String stadt = tfStadt.getText();
|
String city = tfCity.getText();
|
||||||
String strasse = tfStrasse.getText();
|
String street = tfStreet.getText();
|
||||||
String hausnummer = tfHausnummer.getText();
|
String houseNumber = tfHouseNumber.getText();
|
||||||
Alert alert;
|
Alert alert;
|
||||||
if(name.isEmpty() || vorname.isEmpty() || email.isEmpty() || passwort.isEmpty() || plz.isEmpty() ||
|
if(lastName.isEmpty() || firstName.isEmpty() || email.isEmpty() || password.isEmpty() || postCode.isEmpty() ||
|
||||||
stadt.isEmpty() || strasse.isEmpty() || hausnummer.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 = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Name' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (vorname.isEmpty()) {
|
} else if (firstName.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Vorname' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Vorname' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (email.isEmpty()) {
|
} else if (email.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'E-Mail' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'E-Mail' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (passwort.isEmpty()) {
|
} else if (password.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Passwort' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Passwort' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (plz.isEmpty()) {
|
} else if (postCode.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Postleitzahl' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Postleitzahl' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (stadt.isEmpty()) {
|
} else if (city.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Stadt' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Stadt' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
} else if (strasse.isEmpty()) {
|
} else if (street.isEmpty()) {
|
||||||
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Straße' ist leer.");
|
alert = new Alert(Alert.AlertType.ERROR," Die Eingabefeld 'Straße' ist leer.");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
}else {
|
}else {
|
||||||
@ -69,8 +69,8 @@ public class SingUpController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
Address newAdresse = new Address(strasse,hausnummer,plz,stadt);
|
Address newAdresse = new Address(street,houseNumber,postCode,city);
|
||||||
User newUser = new User(name,vorname,passwort,email,newAdresse);
|
User newUser = new User(lastName,firstName,password,email,newAdresse);
|
||||||
if(StartViewApplication.firstLaunch){
|
if(StartViewApplication.firstLaunch){
|
||||||
long id = AccountMgr.createWorker(new Worker(newUser));
|
long id = AccountMgr.createWorker(new Worker(newUser));
|
||||||
if(id < 1) {
|
if(id < 1) {
|
||||||
@ -91,14 +91,14 @@ public class SingUpController {
|
|||||||
alert = new Alert(Alert.AlertType.CONFIRMATION,"Eltern Account erfolgreich erstellt");
|
alert = new Alert(Alert.AlertType.CONFIRMATION,"Eltern Account erfolgreich erstellt");
|
||||||
alert.showAndWait();
|
alert.showAndWait();
|
||||||
}
|
}
|
||||||
tfName.setText("");
|
tfLastName.setText("");
|
||||||
tfVorname.setText("");
|
tfFirstName.setText("");
|
||||||
tfEmail.setText("");
|
tfEmail.setText("");
|
||||||
pfPasswort.setText("");
|
pfPassword.setText("");
|
||||||
tfPLZ.setText("");
|
tfPostCode.setText("");
|
||||||
tfStadt.setText("");
|
tfCity.setText("");
|
||||||
tfStrasse.setText("");
|
tfStreet.setText("");
|
||||||
tfHausnummer.setText("");
|
tfHouseNumber.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<Circle fill="#93c4f23d" layoutY="258.0" radius="106.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 layoutX="262.0" prefHeight="400.0" prefWidth="364.0" style="-fx-background-color: white;">
|
||||||
<children>
|
<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>
|
<effect>
|
||||||
<Blend />
|
<Blend />
|
||||||
</effect>
|
</effect>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
</TextField>
|
</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>
|
<effect>
|
||||||
<Blend />
|
<Blend />
|
||||||
</effect>
|
</effect>
|
||||||
@ -64,7 +64,7 @@
|
|||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
</TextField>
|
</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>
|
||||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
</PasswordField>
|
</PasswordField>
|
||||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||||
<children>
|
<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>
|
<HBox.margin>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</TextField>
|
</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>
|
<HBox.margin>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
@ -100,7 +100,7 @@
|
|||||||
</HBox>
|
</HBox>
|
||||||
<HBox prefHeight="100.0" prefWidth="200.0">
|
<HBox prefHeight="100.0" prefWidth="200.0">
|
||||||
<children>
|
<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>
|
<HBox.margin>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
@ -108,7 +108,7 @@
|
|||||||
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
<Font name="Microsoft Tai Le Bold" size="12.0" />
|
||||||
</font>
|
</font>
|
||||||
</TextField>
|
</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>
|
<HBox.margin>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
|
Loading…
Reference in New Issue
Block a user