datamodule1.java

来自「java在线商店的源代码。编写十分规范的哦」· Java 代码 · 共 1,581 行 · 第 1/5 页

JAVA
1,581
字号

  // Getter methods for Data Access controls


  /**
   * Class method to access the singleton instance of the class.
   * @return DataModule1
   */
  static public DataModule1 getDataModule() {
    if (myDM == null)
      myDM = new DataModule1();
    return myDM;
  }

  /**
   * Method to access the Product DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getProductDataSet() {
    return productDataSet;
  }

  /**
   * Method to access the Category DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getCategoryDataSet() {
    return categoryDataSet;
  }

  /**
   * Method to access the Customer DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getCustomerDataSet() {
    return customerDataSet;
  }

  /**
   * Method to access the Order DataSet that is linked to the
   * Customer DataSet by a MasterLink.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getCustOrderDataSet() {
    return custOrderDataSet;
  }

  /**
   * Method to access the Order DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getOrderDataSet() {
    return orderDataSet;
  }

  /**
   * Method to access the OrderItem DataSet. This is linked to the
   * Order DataSet by a MasterLink.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getOrderItemDataSet() {
    return orderItemDataSet;
  }

  /**
   * Method to access the PayMethod DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getPayMethodDataSet() {
    return payMethodDataSet;
  }

  /**
   * Method to access the ShipMethod DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getShipMethodDataSet() {
    return shipMethodDataSet;
  }

  /**
   * Method to access the Status DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getStatusDataSet() {
    return statusDataSet;
  }

  /**
   * Method to access the Account DataSet.
   * @return com.borland.dx.sql.dataset.QueryDataSet
   */
  public com.borland.dx.sql.dataset.QueryDataSet getAccountDataSet() {
    return accountDataSet;
  }

  /**
   * This method is used to open a connection to the database
   * explicitly.
   * @throws DataSetException datasetexception
   *
   */
  public void dbConnect() throws DataSetException{
    database1.openConnection();
  }


  // Category DataSet EditEvents


  /**
   * Before adding a category row, do row-level validation.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @throws Exception exception
   *
   */
  void categoryDataSet_adding(DataSet dataSet, ReadWriteRow readWriteRow) throws Exception{
    validateCategoryRow();
  }


  /**
   * Before updating a category row, do row-level validation.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @param readRow ReadRow
   * @throws Exception exception
   *
   */
  void categoryDataSet_updating(DataSet dataSet, ReadWriteRow readWriteRow, ReadRow readRow) throws Exception{
    validateCategoryRow();
  }


  /**
   * Before deleting a Category record, prompt the user to confirm delete.
   * @param dataSet DataSet
   * @throws Exception exception
   *
   */
  void categoryDataSet_deleting(DataSet dataSet) throws Exception
  {
    confirmDelete(res.getString("DM_Delete_this_category?"));
  }

  /**
   * When a new record is added, resolve new record to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_added(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }

  /**
   * When a record is updated, resolve updated record to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_updated(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }


  /**
   * When a record is deleted, resolve to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_deleted(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }

  /**
   * When canceling an edit or insert, clear the messages from
   * all status bar controls
   * @param dataSet DataSet
   * @throws Exception exception
   *
   */
  void categoryDataSet_canceling(DataSet dataSet) throws Exception{
    dataSet.clearStatus();
  }


  /**
   * Show an error dialog if error occurs during editing.
   * @param dataSet DataSet
   * @param column Column
   * @param variant Variant
   * @param dataSetException DataSetException
   * @param errorResponse ErrorResponse
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_editError(DataSet dataSet, Column column, Variant variant, DataSetException dataSetException, ErrorResponse errorResponse) throws DataSetException{
    showErrorMsg(dataSetException.getMessage());
  }


  /**
   * Show an error dialog if error occurs during adding.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @param dataSetException DataSetException
   * @param errorResponse ErrorResponse
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_addError(DataSet dataSet, ReadWriteRow readWriteRow, DataSetException dataSetException, ErrorResponse errorResponse) throws DataSetException{
    showErrorMsg(dataSetException.getMessage());
  }


  /**
   * Show an error dialog if error occurs during updating.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @param dataSetException DataSetException
   * @param errorResponse ErrorResponse
   * @throws DataSetException datasetexception
   *
   */
  void categoryDataSet_updateError(DataSet dataSet, ReadWriteRow readWriteRow, DataSetException dataSetException, ErrorResponse errorResponse) throws DataSetException{
    showErrorMsg(dataSetException.getMessage());
  }



  // Product DataSet EditEvents


  /**
   * Before adding a product row, do row-level validation.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @throws Exception exception
   *
   */
  void productDataSet_adding(DataSet dataSet, ReadWriteRow readWriteRow) throws Exception{
    validateProductRow();
  }


  /**
   * Before updating a product row, do row-level validation.
   * @param dataSet DataSet
   * @param readWriteRow ReadWriteRow
   * @param readRow ReadRow
   * @throws Exception exception
   *
   */
  void productDataSet_updating(DataSet dataSet, ReadWriteRow readWriteRow, ReadRow readRow) throws Exception{
    validateProductRow();
  }


  /**
   * Before deleting a Product record, prompt the user to confirm delete.
   * @param dataSet DataSet
   * @throws Exception exception
   *
   */
  void productDataSet_deleting(DataSet dataSet) throws Exception{
    confirmDelete(res.getString("DM_Delete_this_product?"));
  }

  /**
   * When a new record is added, resolve new record to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void productDataSet_added(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }

  /**
   * When a record is updated, resolve updated record to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void productDataSet_updated(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }

  /**
   * When a record is deleted, resolve to the database.
   * @param dataSet DataSet
   * @throws DataSetException datasetexception
   *
   */
  void productDataSet_deleted(DataSet dataSet) throws DataSetException{
    dataSet.saveChanges();
  }

  /**
   * When canceling an edit or insert, clear the messages from
   * all status bar controls
   * @param dataSet DataSet
   * @throws Exception exception
   *
   */
  void productDataSet_canceling(DataSet dataSet) throws Exception{
    dataSet.clearStatus();
  }


  /**
   * Show an error dialog if error occurs during editing.
   * @param dataSet DataSet
   * @param column Column

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?