コード例 #1
0
  private void doRefreshReport(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_doRefreshReport
    Date fromDate = dpStartDate.getDate();
    Date toDate = dpEndDate.getDate();

    if (fromDate.after(toDate)) {
      POSMessageDialog.showError(
          com.floreantpos.util.POSUtil.getFocusedWindow(),
          com.floreantpos.POSConstants.FROM_DATE_CANNOT_BE_GREATER_THAN_TO_DATE_);
      return;
    }

    try {
      reportPanel.removeAll();
      reportPanel.revalidate();

      if (report != null) {
        int reportType = cbReportType.getSelectedIndex();

        report.setReportType(reportType);
        report.setStartDate(fromDate);
        report.setEndDate(toDate);

        report.refresh();

        if (report != null && report.getViewer() != null) {
          reportPanel.add(report.getViewer());
          reportPanel.revalidate();
        }
      }

    } catch (Exception e) {
      MessageDialog.showError(com.floreantpos.POSConstants.ERROR_MESSAGE, e);
    }
  } // GEN-LAST:event_doRefreshReport
コード例 #2
0
 public void actionPerformed(ActionEvent e) {
   try {
     MenuModifierGroupForm editor = new MenuModifierGroupForm();
     BeanEditorDialog dialog =
         new BeanEditorDialog(editor, Application.getInstance().getBackOfficeWindow(), true);
     dialog.open();
   } catch (Exception x) {
     MessageDialog.showError(com.floreantpos.POSConstants.ERROR_MESSAGE, x);
   }
 }
コード例 #3
0
  @Override
  protected boolean updateModel() {
    Tax tax = (Tax) getBean();

    String name = tfName.getText();
    if (POSUtil.isBlankOrNull(name)) {
      MessageDialog.showError(com.floreantpos.POSConstants.NAME_REQUIRED);
      return false;
    }

    tax.setName(name);
    tax.setRate(new Double(tfRate.getValue().toString()).doubleValue());

    return true;
  }
コード例 #4
0
  // End of variables declaration//GEN-END:variables
  @Override
  public boolean save() {

    try {
      if (!updateModel()) return false;

      Tax tax = (Tax) getBean();
      TaxDAO dao = new TaxDAO();
      dao.saveOrUpdate(tax);
    } catch (Exception e) {
      MessageDialog.showError(e);
      return false;
    }

    return true;
  }