use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.
the class WithdrawVoucherDialog method jButton1ActionPerformed.
// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//GEN-FIRST:event_jButton1ActionPerformed
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
String voucherText = new OpenTransactionAccount().withdrawVoucher(serverID, nymID, accountID, jTextField2.getText(), jTextArea1.getText(), jTextField1.getText());
/**
* Reload the inbox and top accounts panel if success
*/
if (voucherText != null) {
new OTVoucherOutput(null, true, voucherText, accountID).setVisible(true);
} else
JOptionPane.showMessageDialog(this, "Error in voucher withdrawal", "Error", JOptionPane.ERROR_MESSAGE);
} catch (Exception e) {
e.printStackTrace();
} finally {
setCursor(Cursor.getDefaultCursor());
}
dispose();
}
use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.
the class OpenTransactionAccountTopPanel method jButton_InActionPerformed.
//GEN-LAST:event_jButton_VerifyFilesActionPerformed
private void jButton_InActionPerformed(java.awt.event.ActionEvent evt) {
//GEN-FIRST:event_jButton_InActionPerformed
try {
OpenTransactionAccount otAccount = new OpenTransactionAccount();
String basket = otAccount.showBasket(jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AssetID.getText());
if (basket != null && basket.length() > 0) {
new ExchangeBasketDialog(null, true, basket, true, jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AccountID.getText(), jTextField_AssetID.getText()).setVisible(true);
} else {
JOptionPane.showMessageDialog(null, "Error getting basket curreny list", "Error", JOptionPane.ERROR_MESSAGE);
}
} catch (InterruptedException ex) {
Logger.getLogger(OpenTransactionAccountTopPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.
the class OTWriteCheque method jButton2ActionPerformed.
//GEN-LAST:event_jTextField1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
//GEN-FIRST:event_jButton2ActionPerformed
try {
if (invoice.equals("-") && jTextField1.getText().contains("-")) {
JOptionPane.showMessageDialog(this, "Please enter positive amount for invoice", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
OpenTransactionAccount openTransactionAccount = new OpenTransactionAccount();
String validFrom = String.valueOf(System.currentTimeMillis() / 1000);
String validTo = String.valueOf(dateField);
/*if(dateField.getDate().getTime()<=System.currentTimeMillis()){
JOptionPane.showMessageDialog(null , "Expiration date should be greater than today","Date error",JOptionPane.ERROR_MESSAGE);
return;
}*/
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
String chequeString = openTransactionAccount.writeCheque(serverID, nymID, accountID, validFrom, validTo, jTextArea1.getText(), jTextField3.getText(), invoice + jTextField1.getText());
System.out.println("chequeString:" + chequeString);
new OTWriteChequeOutput(null, true, chequeString).setVisible(true);
} catch (Exception e) {
e.printStackTrace();
} finally {
this.setCursor(Cursor.getDefaultCursor());
}
this.dispose();
}
use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.
the class MainPage method loadOtherTabAccount.
public static void loadOtherTabAccount(String serverID) {
Account account = null;
for (int i = 0; i < Account.allAccounts.length; i++) {
try {
if (!"OpenTransactionAccount".equals(Account.allAccounts[i]) && !"CashPurseAccount".equals(Account.allAccounts[i])) {
Class obj = Class.forName("com.moneychanger.core." + Account.allAccounts[i]);
account = (Account) obj.newInstance();
if (i == 0) {
account.clearAccountList();
}
account.loadAccount("", serverID, "");
}
} catch (Exception e) {
e.printStackTrace();
}
}
((OtherTabAccountModel) jTable3.getModel()).setValue(account.getAccountList(), jTable3);
}
use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.
the class CashPurseDepositDialog method initValues.
// End of variables declaration//GEN-END:variables
private void initValues() {
OpenTransactionAccount otAccount = new OpenTransactionAccount();
accountMap = otAccount.getAccountsForAssetServer(details.getAssetID(), details.getServerID());
Helpers.populateCombo(accountMap, jComboBox1);
}
Aggregations