Product dataObject = null;
dataObject = selectProduct(product.getProductID());
if (dataObject != null) {
success = false;
throw new AppException("The same ProductID has found on the system", "[Product::addCategory]", null);
}
dataObject = getProductByBarcode(product.getBarcodeNumber());
if (dataObject != null) {
success = false;
throw new AppException("The same Barcode has found on the system", "[Product::addCategory]", null);
}
try {
productDA = new ProductDA(filename, format);
productDA.writeData(product, true);