private void populateTable() {
    DefaultTableModel model = (DefaultTableModel) billjTable1.getModel();

    model.setRowCount(0);
    for (Network n : business.getNetworkList()) {
      for (Enterprise enterprise : n.getEnterpriseDirectory().getEnterpriseList()) {

        if (enterprise instanceof DistributorEnterprise) {
          for (WorkRequest request : enterprise.getWorkQueue().getWorkRequestList()) {

            Object[] row = new Object[5];
            row[0] = request;
            // row[] = request.getSender().getEmployee().getName();
            row[1] =
                request.getReceiver() == null
                    ? null
                    : request.getReceiver().getEmployee().getName();
            row[2] = ((ProviderWorkRequest) request).getOrder();
            row[3] = ((ProviderWorkRequest) request).getTotalPrice();
            row[4] = request.getStatus();

            model.addRow(row);
          }
        }
      }
    }
  }
  private void jButton1ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed
    int selectedRow = billjTable1.getSelectedRow();

    if (selectedRow < 0) {
      return;
    }
    // UserAccount userAccount = null;
    WorkRequest request = (WorkRequest) billjTable1.getValueAt(selectedRow, 0);
    request.setReceiver(userAccount);
    request.setStatus("To bee Paid");
    populateTable(); // TODO add your handling code here:
  } // GEN-LAST:event_jButton1ActionPerformed
  public void populateRequestTable() {
    DefaultTableModel model = (DefaultTableModel) workRequestJTable.getModel();
    model.setRowCount(0);

    for (Organization org : enterprise.getOrganizationDirectory().getOrganizationList()) {
      if (org instanceof CareTeamOrganization) {
        for (WorkRequest request : org.getWorkQueue().getWorkRequestList()) {
          Object[] row = new Object[6];
          row[0] = request;
          row[1] = request.getReceiver();
          row[2] = request.getRequestDate();
          row[3] = ((SurgeryOperationWorkRequest) request).getRequiredCareTeamSize();
          row[4] = ((SurgeryOperationWorkRequest) request).getAssignedTeamSize();
          row[5] = request.getStatus();
          model.addRow(row);
        }
      }
    }
  }
  private void jButton1ActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton1ActionPerformed
    // TODO add your handling code here:

    if (PhysiciansjCheckBox2.isSelected()) {
      ErrorPerson ep1 = workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.PHYSICIAN);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }
    if (nursejCheckBox3.isSelected()) {
      ErrorPerson ep1 = workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.NURESE);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }
    if (pathologistjCheckBox5.isSelected()) {
      ErrorPerson ep1 =
          workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.PATHOLOGIST);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }
    if (phajCheckBox6.isSelected()) {
      ErrorPerson ep1 =
          workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.PHARMACIST);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }
    if (adminstrationjCheckBox1.isSelected()) {
      ErrorPerson ep1 =
          workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.ADMINSTRATION);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }
    if (surgeonjCheckBox4.isSelected()) {
      ErrorPerson ep1 = workRequest.getEpd().createPersonnel(ErrorPerson.ErrorPersonType.SURGEON);
      // doctorReport.getEpd().getErrorpersonlist().add(ep1);
    }

    if (devicejCheckBox1.isSelected()) {
      workRequest.setDevicecause(Device.DEVICE_DEFECT_OR_FAILURE);
    }
    if (useerrorjCheckBox2.isSelected()) {
      workRequest.setDevicecause(Device.USER_ERROR);
    }
    if (unknownjCheckBox4.isSelected()) {
      workRequest.setDevicecause(Device.UNKNOWN);
    }
    if (combinationjCheckBox3.isSelected()) {
      workRequest.setDeviceerror(Device.COMBINATION);
    }

    workRequest.setLocation((String) locationjComboBox1.getSelectedItem());
    workRequest.setDeviceerror((String) devicejComboBox3.getSelectedItem());

    for (Organization o : e.getOrganizationDirectory().getOrganizationList()) {
      if (o instanceof ServiceOrganization) {
        o.getWorkQueue().getWorkRequestList().add(workRequest);
      }
    }
    ua.getWorkQueue().getWorkRequestList().add(workRequest);
    JOptionPane.showMessageDialog(null, "The report has been submitted");
  } // GEN-LAST:event_jButton1ActionPerformed