public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.productIsNotParticularProduct"); return false; } return true; }
@Override public void checkIfBelongsToFamilyIsProductsFamily(final ViewDefinitionState view, final String referenceName) { LookupComponent productLookup = (LookupComponent) view.getComponentByReference(referenceName); Entity product = productLookup.getEntity(); if ((product != null) && !productService.checkIfProductEntityTypeIsCorrect(product, ProductFamilyElementType.PRODUCTS_FAMILY)) { productLookup.addMessage("orderSupplies.materialRequirementCoverage.belongToFamily.isNotProductsFamily", MessageType.FAILURE); } }
public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(companyProductsFamilyDD.getField(PRODUCT), "basic.company.message.productIsNotProductsFamily"); return false; } return true; }
private boolean checkIfBelongsToFamilyIsProductsFamily(final DataDefinition parameterDD, final Entity parameter) { Entity belongsToFamily = parameter.getBelongsToField(ParameterFieldsOS.BELONGS_TO_FAMILY); if ((belongsToFamily != null) && !productService.checkIfProductEntityTypeIsCorrect(belongsToFamily, ProductFamilyElementType.PRODUCTS_FAMILY)) { parameter.addError(parameterDD.getField(ParameterFieldsOS.BELONGS_TO_FAMILY), "basic.parameter.belongToFamily.isNotProductsFamily"); return false; } return true; }
private boolean checkIfBelongsToFamilyIsProductsFamily(final DataDefinition materialRequirementCoverageDD, final Entity materialRequirementCoverage) { Entity belongsToFamily = materialRequirementCoverage.getBelongsToField(CoverageForOrderFields.BELONGS_TO_FAMILY); if ((belongsToFamily != null) && !productService.checkIfProductEntityTypeIsCorrect(belongsToFamily, ProductFamilyElementType.PRODUCTS_FAMILY)) { materialRequirementCoverage.addError( materialRequirementCoverageDD.getField(CoverageForOrderFields.BELONGS_TO_FAMILY), "materialRequirementCoverageForOrder.coverageForOrder.belongToFamily.isNotProductsFamily"); return false; } return true; }
private boolean checkIfBelongsToFamilyIsProductsFamily(final DataDefinition materialRequirementCoverageDD, final Entity materialRequirementCoverage) { Entity belongsToFamily = materialRequirementCoverage .getBelongsToField(MaterialRequirementCoverageFields.BELONGS_TO_FAMILY); if ((belongsToFamily != null) && !productService.checkIfProductEntityTypeIsCorrect(belongsToFamily, ProductFamilyElementType.PRODUCTS_FAMILY)) { materialRequirementCoverage.addError( materialRequirementCoverageDD.getField(MaterialRequirementCoverageFields.BELONGS_TO_FAMILY), "orderSupplies.materialRequirementCoverage.belongToFamily.isNotProductsFamily"); return false; } return true; }
List<Entity> children = product.getHasManyField(ProductFields.PRODUCT_FAMILY_CHILDRENS); for (Entity child : children) { if (productService.checkIfProductEntityTypeIsCorrect(child, ProductFamilyElementType.PRODUCTS_FAMILY)) { List<Entity> familiesCompanies = child.getHasManyField(ProductFieldsD.PRODUCTS_FAMILY_COMPANIES); if (!familiesCompanies.isEmpty()) {