private void saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveActionPerformed
        try{
            if (nameOutlet.getText().isEmpty()
                || codeOutlet.getText().isEmpty()
                || priceAOutlet.getText().isEmpty()
                || priceBOutlet.getText().isEmpty()) {
                JOptionPane.showMessageDialog(null, tools.Utilities.incompleteFormMessage, "Fout!", JOptionPane.WARNING_MESSAGE);
                return;
            }
	    
	    if (!database.Database.driver().isArticleCodeUnique(codeOutlet.getText(), model)) {
		JOptionPane.showMessageDialog(null, "Deze artikelcode is niet uniek!", "Fout!", JOptionPane.WARNING_MESSAGE);
		return;
	    }

            /*
            * Set values on the model
            */
            model.setName(nameOutlet.getText());
            model.setCode(codeOutlet.getText());
            model.setPriceA(Double.parseDouble(priceAOutlet.getText()));
            model.setPriceB(Double.parseDouble(priceBOutlet.getText()));
            model.setUnit(unitOutlet.getText());
            model.setTaxes(Double.parseDouble(taxesOutlet.getText()));
	    
	    // set comments

	    FunctionResult<Article> res = model.update();
	    if (res.getCode() == 0) {
		delegate.editArticle(defaultModel, model);
		disposeLater();
	    } else {
		String msg;
		switch(res.getCode()){
		    case 1: case 2:
			msg = res.getMessage();
			break;
		    default:
			msg = "Er is een fout opgetreden bij het opslaan van dit artikel in de databank (code "+res.getCode()+"). Contacteer de ontwikkelaars met deze informatie.";
		}
		JOptionPane.showMessageDialog(null, msg, "Fout!", JOptionPane.ERROR_MESSAGE);
	    }
        } catch (Exception e){
            System.err.println("Error: \n"+e.getMessage());
            JOptionPane.showMessageDialog(null, tools.Utilities.incorrectFormMessage, "Fout!", JOptionPane.WARNING_MESSAGE);
        }
    }//GEN-LAST:event_saveActionPerformed