Search in sources :

Example 11 with SMException

use of SMExceptions.SMException in project SmartCity-Market by TechnionYP5777.

the class CustomerLoginScreen method guestLoginButtonPressed.

@FXML
private void guestLoginButtonPressed(ActionEvent __) {
    ICustomer customer = InjectionFactory.getInstance(Customer.class);
    try {
        customer.login(guestLogin.getUserName(), guestLogin.getUserName(), true);
    } catch (SMException e) {
        log.fatal(e);
        log.debug(StackTraceUtil.getStackTrace(e));
        e.showInfoToUser();
        return;
    } catch (Exception e) {
        DialogMessagesService.showErrorDialog(e + "", null, "");
        return;
    }
    TempCustomerPassingData.customer = customer;
    AbstractApplicationScreen.setScene("/CustomerMainScreen/CustomerMainScreen.fxml");
}
Also used : ICustomer(CustomerContracts.ICustomer) SMException(SMExceptions.SMException) SMException(SMExceptions.SMException) FXML(javafx.fxml.FXML)

Example 12 with SMException

use of SMExceptions.SMException in project SmartCity-Market by TechnionYP5777.

the class CustomerRegistration_IngredientsScreen method updateIngredientsCheckList.

private void updateIngredientsCheckList() {
    ICustomer customer = InjectionFactory.getInstance(Customer.class);
    try {
        ingredientsObservableList.addAll(customer.getAllIngredients());
    } catch (SMException e) {
        log.fatal(e);
        log.debug(StackTraceUtil.getStackTrace(e));
        e.showInfoToUser();
    }
    ingredientsCheckListView.setItems(ingredientsObservableList);
    HashSet<Ingredient> currentAllergans = TempCustomerProfilePassingData.customerProfile.getAllergens();
    if (currentAllergans != null && !currentAllergans.isEmpty())
        updateListViewWithChosenIngreidients(currentAllergans);
}
Also used : Ingredient(BasicCommonClasses.Ingredient) ICustomer(CustomerContracts.ICustomer) SMException(SMExceptions.SMException)

Aggregations

SMException (SMExceptions.SMException)12 FXML (javafx.fxml.FXML)7 ICustomer (CustomerContracts.ICustomer)5 SmartCode (BasicCommonClasses.SmartCode)3 BarcodeEventHandler (UtilsImplementations.BarcodeEventHandler)2 CartProduct (BasicCommonClasses.CartProduct)1 CatalogProduct (BasicCommonClasses.CatalogProduct)1 CustomerProfile (BasicCommonClasses.CustomerProfile)1 ForgotPasswordData (BasicCommonClasses.ForgotPasswordData)1 ICustomerProfile (BasicCommonClasses.ICustomerProfile)1 Ingredient (BasicCommonClasses.Ingredient)1 Location (BasicCommonClasses.Location)1 ProductPackage (BasicCommonClasses.ProductPackage)1 CommonDiConfigurator (CommonDI.CommonDiConfigurator)1 CLIENT_TYPE (CommonDefs.CLIENT_TYPE)1 CustomerDiConfigurator (CustomerDI.CustomerDiConfigurator)1 EmployeeScreensParameterService (EmployeeCommon.EmployeeScreensParameterService)1 IEmployeeScreensParameterService (EmployeeCommon.IEmployeeScreensParameterService)1 IManager (EmployeeContracts.IManager)1 IWorker (EmployeeContracts.IWorker)1