zwischenschritt
This commit is contained in:
parent
c08e816e93
commit
f59bc8d27f
@ -1,5 +1,6 @@
|
||||
package de.subway_surfers.vpr_app;
|
||||
|
||||
import RestAPISchnittstelle.RestApiClient;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
@ -13,6 +14,8 @@ import java.util.Random;
|
||||
|
||||
public class AccounterstellungMitarbeiter {
|
||||
|
||||
private @FXML TextField accountname;
|
||||
private @FXML TextField email;
|
||||
private @FXML Label status;
|
||||
private @FXML Label einmalpw;
|
||||
private @FXML HBox kindanzeige;
|
||||
@ -114,8 +117,7 @@ public class AccounterstellungMitarbeiter {
|
||||
}
|
||||
|
||||
private boolean eingabenGueltig() {
|
||||
|
||||
return true;
|
||||
return !accountname.getText().equals("") && !email.getText().equals("") && (typEltern.isSelected() || typMitarbeiter.isSelected());
|
||||
}
|
||||
|
||||
public void onSpeichern(ActionEvent actionEvent) {
|
||||
@ -123,6 +125,14 @@ public class AccounterstellungMitarbeiter {
|
||||
status.setText("Daten Erfolgreich gespeichert");
|
||||
einmalpw.setText(einmalPwGenerieren());
|
||||
|
||||
String json = String.format("{\"name\":\"%s\", \"email\":\"%s\", \"passwort\":\"%d\", \"rid\":\"%d\"}",
|
||||
accountname.getText(), email.getText(), einmalpw.getText().hashCode(), (typMitarbeiter.isSelected() ? 0:1));
|
||||
System.out.println(json);
|
||||
RestApiClient api = new RestApiClient();
|
||||
api.post("Benutzerkonto", json);
|
||||
}
|
||||
else {
|
||||
status.setText("Accounterstellung Fehlgeschlagen");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,9 +28,9 @@
|
||||
<VBox styleClass="accounterstellung_links">
|
||||
<GridPane styleClass="accounterstellung_daten">
|
||||
<Label text="Accountname:" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
|
||||
<TextField GridPane.rowIndex="0" GridPane.columnIndex="1"/>
|
||||
<TextField fx:id="accountname" GridPane.rowIndex="0" GridPane.columnIndex="1"/>
|
||||
<Label text="E-Mail:" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
|
||||
<TextField GridPane.rowIndex="1" GridPane.columnIndex="1"/>
|
||||
<TextField fx:id="email" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
|
||||
<RadioButton fx:id="typMitarbeiter" onAction="#onTypMitarbeiter" text="Mitarbeiter" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
|
||||
<RadioButton fx:id="typEltern" onAction="#onTypEltern" text="Eltern" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
|
||||
</GridPane>
|
||||
|
Loading…
Reference in New Issue
Block a user