Esempio n. 1
0
  protected boolean doSave() {
    // TODO Auto-generated method stub
    if (!isDataChanged()) {
      JOptionPane.showMessageDialog(self, "数据未发生变化,不需要保存!", "提示", JOptionPane.INFORMATION_MESSAGE);
      return false;
    }
    EbSite site = (EbSite) this.listCursor.getCurrentObject();
    if (!checkBeforeSave()) return false;
    boolean success = true;
    String errorInfo = "";
    try {
      this.ebayServiceDelegate.saveEbSite(site, requestMeta, this.pageStatus);
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      success = false;
      errorInfo += e.getMessage();
    }
    if (success) {
      this.listCursor.setCurrentObject(site);
      this.oldSite = (EbSite) ObjectUtil.deepCopy(site);
      this.listPanel.refreshCurrentTabData();

      JOptionPane.showMessageDialog(self, "保存成功!", "提示", JOptionPane.INFORMATION_MESSAGE);
      this.pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;
      updateFieldEditorsEditable();
      setButtonStatus();
      setOldObject();
      return true;
    } else {
      JOptionPane.showMessageDialog(this, "保存失败 !\n" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE);
      return false;
    }
  }
Esempio n. 2
0
 private void setOldObject() {
   oldSite = (EbSite) ObjectUtil.deepCopy(listCursor.getCurrentObject());
 }