コード例 #1
0
 public void onNew(@Observes EntityNewEvent event) {
   if (!isValidEvent(event)) {
     return;
   }
   Property treeStructureProperty = entities[0].getProperty(TableTree.PROPERTY_TREESTRUCTURE);
   Property tableProperty = entities[0].getProperty(TableTree.PROPERTY_TABLE);
   String treeStructureValue = (String) event.getCurrentState(treeStructureProperty);
   Table tableValue = (Table) event.getCurrentState(tableProperty);
   checkTreeStructure(tableValue, treeStructureValue, null);
 }
コード例 #2
0
  public void onSave(@Observes EntityNewEvent event) {
    if (!isValidEvent(event)) {
      return;
    }
    ShipmentInOutLine shipmentInOutLine = (ShipmentInOutLine) event.getTargetInstance();

    if (shipmentInOutLine.getProduct() == null
        && (shipmentInOutLine.getMovementQuantity().doubleValue() != 0)) {
      throw new OBException(OBMessageUtils.messageBD("ProductNullAndMovementQtyGreaterZero"));
    }
  }