Search in sources :

Example 1 with ICustomerProfile

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();
    }
}
Also used : ICustomer(CustomerContracts.ICustomer) ForgotPasswordData(BasicCommonClasses.ForgotPasswordData) ICustomerProfile(BasicCommonClasses.ICustomerProfile) ICustomerProfile(BasicCommonClasses.ICustomerProfile) CustomerProfile(BasicCommonClasses.CustomerProfile) SMException(SMExceptions.SMException) FXML(javafx.fxml.FXML)

Aggregations

CustomerProfile (BasicCommonClasses.CustomerProfile)1 ForgotPasswordData (BasicCommonClasses.ForgotPasswordData)1 ICustomerProfile (BasicCommonClasses.ICustomerProfile)1 ICustomer (CustomerContracts.ICustomer)1 SMException (SMExceptions.SMException)1 FXML (javafx.fxml.FXML)1