Package com.moneychanger.core

Examples of com.moneychanger.core.OpenTransactionAccount


        Helpers.obj = obj;
    }

    // OT Helpers
    public static void reloadOTDetails(String accountID) {
        Account account = new OpenTransactionAccount();
        Object details = account.getAccountDetails(accountID);
        OTDetails otDetails = (OTDetails) details;
        populateOTDetails(otDetails);

        JTable table = MainPage.getAccountTable();
        ((AccountTableModel) table.getModel()).setValueAt(otDetails.getBalance(), table.getSelectedRow(), 1);
View Full Code Here


        if (serverMap != null && serverMap.size() > 0 && jComboBoxServerContracts.getSelectedIndex() > 0) {
            serverID = ((String[]) serverMap.get((Integer) jComboBoxServerContracts.getSelectedIndex() - 1))[1];
        }

        // pass serverID and nymID here
        OpenTransactionAccount openTransaction = new OpenTransactionAccount(serverID, nymID);
        try {
            if (userSelection == 0) {
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                boolean status = openTransaction.deleteAccount((String) jTable_AccountTable.getModel().getValueAt(jTable_AccountTable.getSelectedRow(), 3));
                if (status) {
                    JOptionPane.showMessageDialog(this, "Account deleted successfully", "Account deletion", JOptionPane.INFORMATION_MESSAGE);

                    loadAccount(assetID, serverID, nymID);
                    clearDetailPage();
View Full Code Here

        } else {
            jTextField1.setEditable(false);
            jTextField1.setText(((String[]) assetMap.get((Integer) jComboBox1.getSelectedIndex() - 1))[1]);
        }

        accountMap = new OpenTransactionAccount().getAccountID(serverID, nymID,jTextField1.getText().trim());
        Helpers.populateCombo(accountMap, jComboBox4);

}//GEN-LAST:event_jComboBox1ActionPerformed1
View Full Code Here

            jTextField3.setEditable(false);
            jTextField3.setText(((String[]) assetMap.get((Integer) jComboBox2.getSelectedIndex() - 1))[1]);
        }


        accountMapCurrency = new OpenTransactionAccount().getAccountID(serverID, nymID,jTextField3.getText().trim());
        Helpers.populateCombo(accountMapCurrency, jComboBox5);
    }//GEN-LAST:event_jComboBox2ActionPerformed1
View Full Code Here

    }// </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);
View Full Code Here

    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTextField jTextField1;
    // 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);

    }
View Full Code Here

    }

    @Action
    public void ProcessInbox() {
                try {
            OpenTransactionAccount openTransaction = new OpenTransactionAccount();
            Map selectedIndices = new HashMap();
            List finalReceiptRefNo = new ArrayList();
            for (int i = 0; i < jTable_Inbox.getRowCount(); i++) {
                String key = (String) jTable_Inbox.getModel().getValueAt(i, 9);
                if (!Utility.VerifyStringVal(key)) key = new String("");
                if ((Boolean) jTable_Inbox.getModel().getValueAt(i, 7)) {
                    selectedIndices.put(key, true);
                }
                if ((Boolean) jTable_Inbox.getModel().getValueAt(i, 8)) {
                    selectedIndices.put(key, false);
                }
                if ("finalReceipt".equalsIgnoreCase((String) jTable_Inbox.getModel().getValueAt(i, 3)) && (Boolean) jTable_Inbox.getModel().getValueAt(i, 7)) {
                    finalReceiptRefNo.add((String) jTable_Inbox.getModel().getValueAt(i, 1));
                }
            }
            System.out.println("selectedIndices:" + selectedIndices.entrySet());
            if (jTable_Inbox.getRowCount() < 1 || selectedIndices.size() < 1) {
                JOptionPane.showMessageDialog(this, "Please check some transactions to process", "Error", JOptionPane.ERROR_MESSAGE);
                return;
            }

            for (int j = 0; j < finalReceiptRefNo.size(); j++) {
                String referenceNo = (String) finalReceiptRefNo.get(j);
                for (int i = 0; i < jTable_Inbox.getRowCount(); i++) {
                    if (referenceNo.equals((String) jTable_Inbox.getModel().getValueAt(i, 1)) && !(Boolean) jTable_Inbox.getModel().getValueAt(i, 7)) {
                        JOptionPane.showMessageDialog(this, "To close a finalReceipt, you must also close the other receipts that have the same reference number", "Error", JOptionPane.ERROR_MESSAGE);
                        return;

                    }
                }
            }
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            boolean success = openTransaction.processInbox(accountID, selectedIndices);
            if (success) {
                JOptionPane.showMessageDialog(this, "Inbox processed successfully", "Processing Success", JOptionPane.INFORMATION_MESSAGE);
                Helpers.reloadOTDetails(accountID);
                MainPage.reLoadAccount();
                Helpers.setLoadNymTrades(true);
View Full Code Here

    private void jButton_WithdrawCashActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_WithdrawCashActionPerformed
        new WithdrawCashDialog(null, true, jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AccountID.getText()).setVisible(true);
    }//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);
View Full Code Here

    }//GEN-LAST:event_jButton_SendTransferActionPerformed

    private void jButton_DownloadAccountFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_DownloadAccountFilesActionPerformed
        String accountID = jTextField_AccountID.getText();
        try {
            OpenTransactionAccount openTransaction = new OpenTransactionAccount();
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            boolean isSuccess = Helpers.getInboxOutboxAccount(accountID, true); // download the data.
            if (isSuccess) {
                JOptionPane.showMessageDialog(this, "Files downloaded successfully", "Processing Success", JOptionPane.INFORMATION_MESSAGE);
                OpenTransactionAccountBottomPanel.setOTTables(openTransaction.getInboxData(accountID), openTransaction.getOutboxData(accountID));
            } else {
                JOptionPane.showMessageDialog(this, "Error in downloading latest account files", "Server Error", JOptionPane.ERROR_MESSAGE);
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            setCursor(Cursor.getDefaultCursor());
        }
}//GEN-LAST:event_jButton_DownloadAccountFilesActionPerformed

    private void jButton_VerifyFilesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_VerifyFilesActionPerformed
        OpenTransactionAccount otAccount = new OpenTransactionAccount();
        int isSuccess = otAccount.verifyFiles(jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AccountID.getText());
        if (isSuccess == 0) {
            JOptionPane.showMessageDialog(null, "The intermediary files for this account have all been VERIFIED against the last signed receipt", "Verified", JOptionPane.INFORMATION_MESSAGE);
        } else if (isSuccess == 1) {
            JOptionPane.showMessageDialog(null, "The intermediary files for this account have FAILED to verify against the last signed receipt", "Error", JOptionPane.ERROR_MESSAGE);
        } else if (isSuccess == 2) {
View Full Code Here

TOP

Related Classes of com.moneychanger.core.OpenTransactionAccount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.