src/Model/Inventory.java
// Checks to see whether a product can be deleted or not (checks whether the product contains any parts)
Checks to see whether a product can be deleted or not (checks whether the product contains any parts)
Checks to see whether a product can be deleted or not ( checks whether the product contains any parts )
public static boolean deleteProductCheck(Product selectedProduct) {
        boolean okayToDeleteProduct = false;
        int selectedProductID = selectedProduct.getId();
        for (int i = 0; i < allProducts.size(); i++) {
            if (allProducts.get(i).getId() == selectedProductID) {
                if (allProducts.get(i).getAllAssociatedParts().isEmpty()) {
                    okayToDeleteProduct = true;
                }
            }
        }
        return okayToDeleteProduct;
    }
public static boolean deleteProductCheck ( Product selectedProduct ) { boolean okayToDeleteProduct = false ; int selectedProductID = selectedProduct . getId ( ) ; for ( int i = 0 ; i < allProducts . size ( ) ; i ++ ) { if ( allProducts . get ( i ) . getId ( ) == selectedProductID ) { if ( allProducts . get ( i ) . getAllAssociatedParts ( ) . isEmpty ( ) ) { okayToDeleteProduct = true ; } } } return okayToDeleteProduct ; }
Checks to see whether a product can be deleted or not (checks whether the product contains any parts)
Checks to see whether a product can be deleted or not ( checks whether the product contains any parts )