Search in sources :

Example 11 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class OpenTransactionAccountTopPanel method jButton_DepositCashActionPerformed.

//GEN-LAST:event_jButton_WithdrawCashActionPerformed
private void jButton_DepositCashActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_DepositCashActionPerformed
    String[] purseDetails = new OpenTransactionAccount().getPurseBalance(jTextField_ServerID.getText(), jTextField_AssetID.getText(), jTextField_NymID.getText());
    /*if(purseDetails==null){
        JOptionPane.showMessageDialog(this, "Error in cash deposit. Empty purse","Error",JOptionPane.ERROR_MESSAGE);
        return;
        }*/
    new DepositCashDialog(null, true, purseDetails, jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AccountID.getText()).setVisible(true);
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount) DepositCashDialog(com.moneychanger.ui.dialogs.DepositCashDialog)

Example 12 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class ExchangeBasketAcctDialog method initValues.

// End of variables declaration//GEN-END:variables
private void initValues() {
    OpenTransactionAccount otAccount = new OpenTransactionAccount();
    accountMap = otAccount.getAccounts(assetID, nymID, serverID);
    Helpers.populateComboWithoutAll(accountMap, jComboBox1);
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 13 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class SendTransferDialog method jButton1ActionPerformed.

// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton1ActionPerformed
    try {
        if (!Helpers.isValidDouble(jTextField2.getText())) {
            JOptionPane.showMessageDialog(this, "Please enter valid number for amount", "Number Format Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        System.out.println("serverID:" + serverID + ",nymID:" + nymID + ",accountID:" + accountID);
        boolean success = new OpenTransactionAccount().sendTransfer(serverID, nymID, accountID, jTextField2.getText(), jTextArea1.getText(), jTextField1.getText());
        /**
             * Reload the inbox and top accounts panel if success
             */
        if (success) {
            JOptionPane.showMessageDialog(this, "Account to Account Transfer done successfully", "Success", JOptionPane.INFORMATION_MESSAGE);
            Helpers.reloadOTDetails(accountID);
            MainPage.reLoadAccount();
        } else
            JOptionPane.showMessageDialog(this, "Error in Account to Account transfer", "Server Error", JOptionPane.ERROR_MESSAGE);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        setCursor(Cursor.getDefaultCursor());
    }
    dispose();
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 14 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class SendTransferDialog method initValues.

// End of variables declaration//GEN-END:variables
private void initValues() {
    OpenTransactionAccount otAccount = new OpenTransactionAccount();
    accountMap = otAccount.getAccounts(accountID, serverID);
    Helpers.populateCombo(accountMap, jComboBox1);
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 15 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class WithdrawCashDialog method jButton1ActionPerformed.

// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton1ActionPerformed
    try {
        if (!Helpers.isValidDouble(jTextField1.getText())) {
            JOptionPane.showMessageDialog(this, "Please enter valid number", "Number Format Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        boolean success = new OpenTransactionAccount().withdrawCash(serverID, nymID, accountID, jTextField1.getText());
        /**
             * Reload the inbox and top accounts panel if success
             */
        if (success) {
            JOptionPane.showMessageDialog(this, "Cash withdrawn successfully", "Success", JOptionPane.INFORMATION_MESSAGE);
            Helpers.reloadOTDetails(accountID);
            MainPage.reLoadAccount();
        } else {
            JOptionPane.showMessageDialog(this, "Error in cash withdrawal", "Error", JOptionPane.ERROR_MESSAGE);
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        setCursor(Cursor.getDefaultCursor());
    }
    this.dispose();
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Aggregations

OpenTransactionAccount (com.moneychanger.core.OpenTransactionAccount)22 Account (com.moneychanger.core.Account)5 AWTException (java.awt.AWTException)5 Point (java.awt.Point)5 RippleAccount (com.moneychanger.core.RippleAccount)4 OTDetails (com.moneychanger.core.dataobjects.OTDetails)2 ComboObject (com.moneychanger.core.util.ComboObject)2 ExchangeBasketDialog (com.moneychanger.ui.dialogs.ExchangeBasketDialog)2 AccountTableModel (com.moneychanger.ui.model.AccountTableModel)2 OtherTabAccountModel (com.moneychanger.ui.model.OtherTabAccountModel)2 CardLayout (java.awt.CardLayout)2 JPanel (javax.swing.JPanel)2 ListSelectionEvent (javax.swing.event.ListSelectionEvent)2 ListSelectionListener (javax.swing.event.ListSelectionListener)2 Contract (com.moneychanger.core.Contract)1 NYM (com.moneychanger.core.NYM)1 BitcoinDetails (com.moneychanger.core.dataobjects.BitcoinDetails)1 CashPurseDetails (com.moneychanger.core.dataobjects.CashPurseDetails)1 DepositCashDialog (com.moneychanger.ui.dialogs.DepositCashDialog)1 BlankPanel (com.moneychanger.ui.panels.BlankPanel)1