Search in sources :

Example 6 with ConnectionFailure

use of EmployeeDefs.AEmployeeException.ConnectionFailure in project SmartCity-Market by TechnionYP5777.

the class ManageCatalogProductDetailsTab method renameIngrPressed.

void renameIngrPressed() {
    long id = ingredients.get(selectedIngr.iterator().next()).getId();
    try {
        manager.editIngredient(new Ingredient(id, renameIngrLbl.getText()));
    } catch (InvalidParameter | CriticalError | EmployeeNotConnected | ConnectionFailure | ParamIDDoesNotExist e) {
        log.debug(StackTraceUtil.getStackTrace(e));
        log.fatal(e);
        e.showInfoToUser();
    }
    selectedIngr.clear();
    createIngredientList();
    enableButtons();
    enableAddButtons();
}
Also used : InvalidParameter(EmployeeDefs.AEmployeeException.InvalidParameter) CriticalError(SMExceptions.CommonExceptions.CriticalError) ConnectionFailure(EmployeeDefs.AEmployeeException.ConnectionFailure) Ingredient(BasicCommonClasses.Ingredient) ParamIDDoesNotExist(EmployeeDefs.AEmployeeException.ParamIDDoesNotExist) EmployeeNotConnected(EmployeeDefs.AEmployeeException.EmployeeNotConnected)

Example 7 with ConnectionFailure

use of EmployeeDefs.AEmployeeException.ConnectionFailure in project SmartCity-Market by TechnionYP5777.

the class ManageCatalogProductDetailsTab method addManuPressed.

void addManuPressed() {
    try {
        manager.addManufacturer(new Manufacturer(0, newManu.getText()));
    } catch (InvalidParameter | CriticalError | EmployeeNotConnected | ConnectionFailure | ParamIDAlreadyExists e) {
        log.fatal(e);
        log.debug(StackTraceUtil.getStackTrace(e));
        e.showInfoToUser();
    }
    selectedManu.clear();
    createManufacturerList();
    enableButtons();
    enableAddButtons();
}
Also used : InvalidParameter(EmployeeDefs.AEmployeeException.InvalidParameter) CriticalError(SMExceptions.CommonExceptions.CriticalError) ConnectionFailure(EmployeeDefs.AEmployeeException.ConnectionFailure) Manufacturer(BasicCommonClasses.Manufacturer) ParamIDAlreadyExists(EmployeeDefs.AEmployeeException.ParamIDAlreadyExists) EmployeeNotConnected(EmployeeDefs.AEmployeeException.EmployeeNotConnected)

Aggregations

ConnectionFailure (EmployeeDefs.AEmployeeException.ConnectionFailure)7 EmployeeNotConnected (EmployeeDefs.AEmployeeException.EmployeeNotConnected)6 InvalidParameter (EmployeeDefs.AEmployeeException.InvalidParameter)6 CriticalError (SMExceptions.CommonExceptions.CriticalError)6 Manufacturer (BasicCommonClasses.Manufacturer)3 Ingredient (BasicCommonClasses.Ingredient)2 ParamIDAlreadyExists (EmployeeDefs.AEmployeeException.ParamIDAlreadyExists)2 ParamIDDoesNotExist (EmployeeDefs.AEmployeeException.ParamIDDoesNotExist)2 IOException (java.io.IOException)2 CatalogProduct (BasicCommonClasses.CatalogProduct)1 ForgotPasswordData (BasicCommonClasses.ForgotPasswordData)1 Login (BasicCommonClasses.Login)1 SmartCode (BasicCommonClasses.SmartCode)1 CommandWrapper (ClientServerApi.CommandWrapper)1 ProductNotExistInCatalog (EmployeeDefs.AEmployeeException.ProductNotExistInCatalog)1 WorkerAlreadyExists (EmployeeDefs.AEmployeeException.WorkerAlreadyExists)1 FXML (javafx.fxml.FXML)1 Test (org.junit.Test)1