예제 #1
0
 /**
  * Load Information
  *
  * @param C_ValidCombination_ID valid combination
  * @param C_AcctSchema_ID acct schema
  */
 private void loadInfo(int C_ValidCombination_ID, int C_AcctSchema_ID) {
   log.fine("C_ValidCombination_ID=" + C_ValidCombination_ID);
   String sql =
       "SELECT * FROM C_ValidCombination WHERE C_ValidCombination_ID=? AND C_AcctSchema_ID=?";
   try {
     PreparedStatement pstmt = DB.prepareStatement(sql, null);
     pstmt.setInt(1, C_ValidCombination_ID);
     pstmt.setInt(2, C_AcctSchema_ID);
     ResultSet rs = pstmt.executeQuery();
     if (rs.next()) {
       if (f_Alias != null) f_Alias.setValue(rs.getString("Alias"));
       f_Combination.setValue(rs.getString("Combination"));
       //
       loadInfoOf(rs, f_AD_Org_ID, "AD_Org_ID");
       loadInfoOf(rs, f_Account_ID, "Account_ID");
       loadInfoOf(rs, f_SubAcct_ID, "C_SubAcct_ID");
       //
       loadInfoOf(rs, f_M_Product_ID, "M_Product_ID");
       loadInfoOf(rs, f_C_BPartner_ID, "C_BPartner_ID");
       loadInfoOf(rs, f_C_Campaign_ID, "C_Campaign_ID");
       loadInfoOf(rs, f_C_LocFrom_ID, "C_LocFrom_ID");
       loadInfoOf(rs, f_C_LocTo_ID, "C_LocTo_ID");
       loadInfoOf(rs, f_C_Project_ID, "C_Project_ID");
       loadInfoOf(rs, f_C_SalesRegion_ID, "C_SalesRegion_ID");
       loadInfoOf(rs, f_AD_OrgTrx_ID, "AD_OrgTrx_ID");
       loadInfoOf(rs, f_C_Activity_ID, "C_Activity_ID");
       loadInfoOf(rs, f_User1_ID, "User1_ID");
       loadInfoOf(rs, f_User2_ID, "User2_ID");
       //
       f_Description.setText(rs.getString("Description"));
     }
     rs.close();
     pstmt.close();
   } catch (SQLException e) {
     log.log(Level.SEVERE, sql, e);
   }
 } //	loadInfo
예제 #2
0
  /** Ignore */
  private void action_Ignore() {
    if (f_Alias != null) f_Alias.setValue("");
    f_Combination.setValue("");
    f_Description.setText("");
    //
    //	Org (mandatory)
    f_AD_Org_ID.setValue(null);
    //	Account (mandatory)
    f_Account_ID.setValue(null);
    if (f_SubAcct_ID != null) f_SubAcct_ID.setValue(null);

    //	Product
    if (f_M_Product_ID != null) f_M_Product_ID.setValue(null);
    //	BPartner
    if (f_C_BPartner_ID != null) f_C_BPartner_ID.setValue(null);
    //	Campaign
    if (f_C_Campaign_ID != null) f_C_Campaign_ID.setValue(null);
    //	Loc From
    if (f_C_LocFrom_ID != null) f_C_LocFrom_ID.setValue(null);
    //	Loc To
    if (f_C_LocTo_ID != null) f_C_LocTo_ID.setValue(null);
    //	Project
    if (f_C_Project_ID != null) f_C_Project_ID.setValue(null);
    //	SRegion
    if (f_C_SalesRegion_ID != null) f_C_SalesRegion_ID.setValue(null);
    //	Org Trx
    if (f_AD_OrgTrx_ID != null) f_AD_OrgTrx_ID.setValue(null);
    //	Activity
    if (f_C_Activity_ID != null) f_C_Activity_ID.setValue(null);
    //	User 1
    if (f_User1_ID != null) f_User1_ID.setValue(null);
    //	User 2
    if (f_User2_ID != null) f_User2_ID.setValue(null);
  } //	action_Ignore
예제 #3
0
 /**
  * Set Value of Editor
  *
  * @param rs result set
  * @param editor editor
  * @param name name
  * @throws SQLException
  */
 private void loadInfoOf(ResultSet rs, VEditor editor, String name) throws SQLException {
   if (editor == null) return;
   int intValue = rs.getInt(name);
   if (rs.wasNull()) editor.setValue(null);
   else editor.setValue(new Integer(intValue));
 } //	loadInfoOf