Search in sources :

Example 1 with GoToRegistration

use of operation.GoToRegistration in project Money-Manager by krHasan.

the class SignInController method newUser.

@FXML
private void newUser(MouseEvent event) {
    if (checkUserPresence()) {
        imgSignIn.setVisible(true);
        txtSQAnswer.clear();
        Alert alert = new Alert(AlertType.CONFIRMATION);
        alert.setTitle("Confirmation");
        alert.setHeaderText("Only one user can use this at a time");
        alert.setContentText("User exists, Delete this one?");
        Stage SignInStage = (Stage) lblNewUser.getScene().getWindow();
        alert.setX(SignInStage.getX() + 200);
        alert.setY(SignInStage.getY() + 170);
        Optional<ButtonType> result = alert.showAndWait();
        if (result.get() == ButtonType.OK) {
            (new TabAccess()).setreRegistrationLodingStatus("deleteUser");
            (new GoToRegistration()).goToReRegistration(SignInStage);
        }
    } else {
        Stage SignInStage = (Stage) lblNewUser.getScene().getWindow();
        (new GoToRegistration()).goToRegistration(SignInStage);
    }
}
Also used : GoToRegistration(operation.GoToRegistration) Stage(javafx.stage.Stage) Alert(javafx.scene.control.Alert) TabAccess(tab.TabAccess) ButtonType(javafx.scene.control.ButtonType) FXML(javafx.fxml.FXML)

Example 2 with GoToRegistration

use of operation.GoToRegistration in project Money-Manager by krHasan.

the class SignInController method passwordChangeOk.

@FXML
private void passwordChangeOk(ActionEvent event) {
    if (!new SignInModel().securityQuestionAnswerIsOk(txtSQAnswer.getText())) {
        lblForgetPassMsg.setText("Answer didn't match");
        txtSQAnswer.clear();
    } else if (!cmboSecurityQuetion.getValue().equals(getSavedSecurityQuestion())) {
        lblForgetPassMsg.setText("Question didn't match");
        txtSQAnswer.clear();
    } else {
        (new TabAccess()).setreRegistrationLodingStatus("forgotPassword");
        Stage SignInStage = (Stage) btnOk.getScene().getWindow();
        (new GoToRegistration()).goToReRegistration(SignInStage);
    }
}
Also used : GoToRegistration(operation.GoToRegistration) Stage(javafx.stage.Stage) SignInModel(model.SignInModel) TabAccess(tab.TabAccess) FXML(javafx.fxml.FXML)

Aggregations

FXML (javafx.fxml.FXML)2 Stage (javafx.stage.Stage)2 GoToRegistration (operation.GoToRegistration)2 TabAccess (tab.TabAccess)2 Alert (javafx.scene.control.Alert)1 ButtonType (javafx.scene.control.ButtonType)1 SignInModel (model.SignInModel)1