zwischenschritt
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
				
			|||||||
package de.subway_surfers.vpr_app;
 | 
					package de.subway_surfers.vpr_app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import RestAPISchnittstelle.RestApiClient;
 | 
				
			||||||
import javafx.collections.ListChangeListener;
 | 
					import javafx.collections.ListChangeListener;
 | 
				
			||||||
import javafx.event.ActionEvent;
 | 
					import javafx.event.ActionEvent;
 | 
				
			||||||
import javafx.fxml.FXML;
 | 
					import javafx.fxml.FXML;
 | 
				
			||||||
@@ -13,6 +14,8 @@ import java.util.Random;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
public class AccounterstellungMitarbeiter {
 | 
					public class AccounterstellungMitarbeiter {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private @FXML TextField accountname;
 | 
				
			||||||
 | 
						private @FXML TextField email;
 | 
				
			||||||
	private @FXML Label status;
 | 
						private @FXML Label status;
 | 
				
			||||||
	private @FXML Label einmalpw;
 | 
						private @FXML Label einmalpw;
 | 
				
			||||||
	private @FXML HBox kindanzeige;
 | 
						private @FXML HBox kindanzeige;
 | 
				
			||||||
@@ -114,8 +117,7 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private boolean eingabenGueltig() {
 | 
						private boolean eingabenGueltig() {
 | 
				
			||||||
 | 
							return !accountname.getText().equals("") && !email.getText().equals("") && (typEltern.isSelected() || typMitarbeiter.isSelected());
 | 
				
			||||||
		return true;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void onSpeichern(ActionEvent actionEvent) {
 | 
						public void onSpeichern(ActionEvent actionEvent) {
 | 
				
			||||||
@@ -123,6 +125,14 @@ public class AccounterstellungMitarbeiter {
 | 
				
			|||||||
			status.setText("Daten Erfolgreich gespeichert");
 | 
								status.setText("Daten Erfolgreich gespeichert");
 | 
				
			||||||
			einmalpw.setText(einmalPwGenerieren());
 | 
								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">
 | 
					                <VBox styleClass="accounterstellung_links">
 | 
				
			||||||
                    <GridPane styleClass="accounterstellung_daten">
 | 
					                    <GridPane styleClass="accounterstellung_daten">
 | 
				
			||||||
                        <Label text="Accountname:" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
 | 
					                        <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"/>
 | 
					                        <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="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"/>
 | 
					                        <RadioButton fx:id="typEltern" onAction="#onTypEltern" text="Eltern" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
 | 
				
			||||||
                    </GridPane>
 | 
					                    </GridPane>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user