src/Model/Part.java
// Exception handling for entered field values
Exception handling for entered field values
Exception handling for entered field values
public static String partValueExceptions(double partPrice, int partStockLevel, int partMinStockLevel, int partMaxStockLevel, String partValueException) {
        if (partPrice <= 0) {
            partValueException = partValueException + "\nPart Price cannot be $0 or negative.";
        }
        if (partStockLevel < 1) {
            partValueException = partValueException + "\nPart Stock Level cannot be zero.";
        }
        if (partStockLevel < partMinStockLevel) {
            partValueException = partValueException + "\nPart Stock Level must be greater than its Minimum Stock Level requirement.";
        }
        if (partStockLevel > partMaxStockLevel) {
            partValueException = partValueException + "\nPart Stock Level must be less than its Maximum Stock Level requirement.";
        }
        if (partMinStockLevel > partMaxStockLevel) {
            partValueException = partValueException + "\nPart Minimum Stock Level cannot be greater than its Maximum Stock Level.";
        }
        return partValueException;
    }
public static String partValueExceptions ( double partPrice , int partStockLevel , int partMinStockLevel , int partMaxStockLevel , String partValueException ) { if ( partPrice <= 0 ) { partValueException = partValueException + "\nPart Price cannot be $0 or negative." ; } if ( partStockLevel < 1 ) { partValueException = partValueException + "\nPart Stock Level cannot be zero." ; } if ( partStockLevel < partMinStockLevel ) { partValueException = partValueException + "\nPart Stock Level must be greater than its Minimum Stock Level requirement." ; } if ( partStockLevel > partMaxStockLevel ) { partValueException = partValueException + "\nPart Stock Level must be less than its Maximum Stock Level requirement." ; } if ( partMinStockLevel > partMaxStockLevel ) { partValueException = partValueException + "\nPart Minimum Stock Level cannot be greater than its Maximum Stock Level." ; } return partValueException ; }
Exception handling for entered field values
Exception handling for entered field values