예제 #1
0
파일: Edit.java 프로젝트: cewei/Log_System
 public String save_action() {
   try {
     para_inventoryDataProvider.commitChanges();
     return "editToView";
   } catch (Exception ex) {
     log(" ERROR - para_inventory.Edit : Error Description", ex);
     error(" ERROR - " + ex.getMessage());
     return null;
   }
 }
예제 #2
0
파일: Edit.java 프로젝트: cewei/Log_System
  public String edit_action() {
    int selectedRows = getTableRowGroup1().getSelectedRowsCount();
    if (selectedRows > 0) {
      RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
      for (int i = 0; i < selectedRowKeys.length; i++) {
        para_loanDataProvider.setCursorRow(selectedRowKeys[i]);

        para_loanDataProvider.setValue("date_in", calendar1.getValue());

        String[] fieldKeys = {
          "para_inventory.type_prefix_no", "para_inventory.chute_no", "para_inventory.serial_no"
        };
        Object[] values = {
          para_loanDataProvider.getValue("type_prefix_no"),
          para_loanDataProvider.getValue("chute_no"),
          para_loanDataProvider.getValue("serial_no")
        };
        RowKey[] rks = para_inventoryDataProvider.findAll(fieldKeys, values);

        if (rks.length == 1) {
          para_inventoryDataProvider.setCursorRow(rks[0]);
          para_inventoryDataProvider.setValue("para_inventory.status", "returned");

          para_loanDataProvider.commitChanges();
          para_inventoryDataProvider.commitChanges();
        } else {
          log(" ERROR - para_packing.Add : Too many parachutes");
          error(" ERROR - Too many parachutes");
          return null;
        }
      }
      return "editToView";
    } else {
      log(" INFO - para_loan.Edit : No row selected");
      info(" INFO - Please select a row.");
      return null;
    }
  }
예제 #3
0
파일: Edit.java 프로젝트: cewei/Log_System
 /**
  * Callback method that is called after rendering is completed for this request, if <code>init()
  * </code> was called (regardless of whether or not this was the page that was actually rendered).
  * Customize this method to release resources acquired in the <code>init()</code>, <code>
  * preprocess()</code>, or <code>prerender()</code> methods (or acquired during execution of an
  * event handler).
  */
 @Override
 public void destroy() {
   para_inventoryDataProvider.close();
   para_typeDataProvider.close();
 }
예제 #4
0
 /**
  * Callback method that is called after rendering is completed for this request, if <code>init()
  * </code> was called (regardless of whether or not this was the page that was actually rendered).
  * Customize this method to release resources acquired in the <code>init()</code>, <code>
  * preprocess()</code>, or <code>prerender()</code> methods (or acquired during execution of an
  * event handler).
  */
 @Override
 public void destroy() {
   para_packing_viewDataProvider.close();
 }