private void checkOutJButtonActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_checkOutJButtonActionPerformed // TODO add your handling code here: Order o = moc.addOrder(order); // customer.addOrder(order); OrderWorkRequest owr = new OrderWorkRequest(); owr.setOrder(order); owr.setSender(userAccount); owr.setStatus(WorkRequest.Status.SENT.getValue()); userAccount.getWorkQueue().getWorkRequests().add(owr); for (Organization orgn : business.getOrganizationDirectory().getOrganizationDirectory()) { if (orgn instanceof SalesSpecialistOrganization) { orgn.getWorkQueue().getWorkRequests().add(owr); } } if (o != null) { setSoldQuantity(); JOptionPane.showMessageDialog(null, "You have successfully checked out.!!"); } else { JOptionPane.showMessageDialog(null, "Checked out Errrr.!!"); return; } isCheckedOut = true; order = new Order(); txtModifyQuantity.setText(""); populateOrderItemTable(); populateProductTable(); } // GEN-LAST:event_checkOutJButtonActionPerformed
/** Creates new form BrowseProductJPanel */ public BrowseProductJPanel( JPanel userProcessContainer, Business business, UserAccount userAccount) { initComponents(); this.business = business; this.userProcessContainer = userProcessContainer; this.moc = business.getMasterOrderCatalog(); this.customer = (Customer) userAccount.getEmployee(); this.userAccount = userAccount; for (Organization o : business.getOrganizationDirectory().getOrganizationDirectory()) { if (o.getOrganizationName().equals(Organization.TypeOfOrg.Supplier.getValue())) { employeeDirectory = o.getEmployeeDirectory(); } } customerName.setText("Welcome :" + customer.getName()); if (!isCheckedOut) { order = new Order(); } populateSupplierCombox(); populateProductTable(); }