private void productionGoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productionGoButtonActionPerformed

        String cropfield = (String) prodCropFieldComboBox.getSelectedItem();
        String cropType = (String) cropTypeInFieldComboBox.getSelectedItem();
        String obs = productionObservationsTextField.getText();
        String dofh = dateOfHarvestTextField.getText();
        String quant = quantityTextField.getText();
        int a = this.inserEditProductionComboBox.getSelectedIndex();
        if (a == 0)//if selected value is insert
        {
            InsertProduction ins = new InsertProduction(cropfield, cropType, obs, dofh, quant);
            this.clearProductionTextFields();

        } else if (a == 1)//if selected value is edit
        {

            String id = prodIdTextField.getText();
            SelectFarmFieldDetails ff = new SelectFarmFieldDetails();
            ff.SelectFarmFieldDetailsWithName(cropfield);
            String fid = ff.getID();
            SelectCropTypeDetails ctd = new SelectCropTypeDetails();
            ctd.SelectCropTypeDetailsWithName(cropType);
            String cid = ctd.getID();
            SelectCropFieldDetails cfd = new SelectCropFieldDetails();
            cfd.SelectCropFieldDetailsWithFidCid(fid, cid);
            String cfid = cfd.getID();

            if (id.length() > 0 && quant.length() > 0 && dofh.length() > 0 && obs.length() > 0 && cfid.length() > 0) {
                UpdateProductionRecord u = new UpdateProductionRecord(id, quant, dofh, obs, cfid);
                this.clearProductionTextFields();
            }

        } else if (a == 2)//if selected value is delete
        {
            String bid = prodIdTextField.getText();
            if (bid.length() > 0) {
                DeleteProduction del = new DeleteProduction(bid);
                this.clearProductionTextFields();
            }

        }
    }//GEN-LAST:event_productionGoButtonActionPerformed