+
+ private void buttonMarkAsAwaitingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMarkAsAwaitingActionPerformed
+ // TODO add your handling code here:
+ DBItem selitem = (DBItem)comboClients.getSelectedItem();
+ if (selitem == null) return;
+ ArrayList<Object> client = Utility.getClientDetails(selitem.getKey());
+ if (client == null) {
+ JOptionPane.showMessageDialog(this, ERROR_CLIENT_DETAILS);
+ return;
+ } else if (client.isEmpty()) {
+ JOptionPane.showMessageDialog(this, ERROR_CLIENT_DETAILS);
+ return;
+ }
+
+ int conf = JOptionPane.showConfirmDialog(this, MARK_RAISED_CONFIRM);
+ if (conf == JOptionPane.YES_OPTION) {
+ boolean rt = Utility.updateNoticeBillStatus (selitem.getKey(), "RAISED",
+ "AWAITING PAYMENT");
+ if (rt == false)
+ JOptionPane.showMessageDialog(this, ERROR_UPDATING);
+ else
+ JOptionPane.showMessageDialog(this, UPDATED_SUCCESSFULLY);
+
+ }
+
+
+ }//GEN-LAST:event_buttonMarkAsAwaitingActionPerformed
+ private static final String UPDATED_SUCCESSFULLY = "Updated bill status successfully";
+ private static final String ERROR_UPDATING = "Error in updating";
+ private static final String MARK_RAISED_CONFIRM = "This will change the status of "
+ + "all raised bills for this client to 'awaiting payment' - are you sure?";