Search in sources :

Example 1 with IManager

use of EmployeeContracts.IManager in project SmartCity-Market by TechnionYP5777.

the class EmployeeLoginScreen method loginButtonPressed.

@FXML
private void loginButtonPressed(ActionEvent __) {
    if (loginButton.isDisable())
        return;
    IManager employee = InjectionFactory.getInstance(Manager.class);
    CLIENT_TYPE employeeType = null;
    try {
        employeeType = employee.login(userNameTextField.getText(), passwordField.getText(), true);
    } catch (SMException e) {
        log.fatal(e);
        log.debug(StackTraceUtil.getStackTrace(e));
        e.showInfoToUser();
        return;
    }
    InjectionFactory.getInstance(EmployeeScreensParameterService.class).setClientType(employeeType);
    AbstractApplicationScreen.setScene("/EmployeeMenuScreen/EmployeeMenuScreen.fxml");
}
Also used : CLIENT_TYPE(CommonDefs.CLIENT_TYPE) IManager(EmployeeContracts.IManager) EmployeeScreensParameterService(EmployeeCommon.EmployeeScreensParameterService) SMException(SMExceptions.SMException) FXML(javafx.fxml.FXML)

Aggregations

CLIENT_TYPE (CommonDefs.CLIENT_TYPE)1 EmployeeScreensParameterService (EmployeeCommon.EmployeeScreensParameterService)1 IManager (EmployeeContracts.IManager)1 SMException (SMExceptions.SMException)1 FXML (javafx.fxml.FXML)1