use of BasicCommonClasses.ICustomerProfile in project SmartCity-Market by TechnionYP5777.
the class CustomerRegistration_FinalStepScreen method registerButtonPressed.
@FXML
void registerButtonPressed(ActionEvent __) {
ICustomer customer = InjectionFactory.getInstance(Customer.class);
ICustomerProfile iProfile = TempCustomerProfilePassingData.customerProfile;
CustomerProfile profile = new CustomerProfile(iProfile.getUserName(), TempCustomerProfilePassingData.password, iProfile.getFirstName(), iProfile.getLastName(), iProfile.getPhoneNumber(), iProfile.getEmailAddress(), iProfile.getCity(), iProfile.getStreet(), iProfile.getBirthdate(), iProfile.getAllergens(), new ForgotPasswordData(TempCustomerProfilePassingData.sequrityQuestion, TempCustomerProfilePassingData.sequrityAnswer));
try {
customer.registerNewCustomer(profile);
AbstractApplicationScreen.setScene("/CustomerLoginScreen/CustomerLoginScreen.fxml");
TempCustomerProfilePassingData.clear();
} catch (SMException e) {
log.fatal(e);
log.debug(StackTraceUtil.getStackTrace(e));
e.showInfoToUser();
}
}
Aggregations