Package br.com.visualmidia.persistence

Examples of br.com.visualmidia.persistence.GetAccountByName


       
        TableItem[] items = accountsTable.getItems();
        for (TableItem item : items) {
            if(item.getChecked()) {
                try {
                    Account account = (Account) system.query(new GetAccountByName(item.getText()));
                    accountsMap.put(account.getId(), account);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
View Full Code Here


                    List<Account> accounts = (List<Account>) system.query(new GetBankAccountsByNumber(accountNumber));
                    if(accounts.size() > 1){
                      ChooseAccountImportExtractBankItemDialog dialog = new ChooseAccountImportExtractBankItemDialog(mainScreen.getShell(), accounts);
                      dialog.open();
                      if(dialog.getReturnCode() == TitleAreaDialog.OK){
                        Account account = (Account) system.query(new GetAccountByName(dialog.getAccountName()));
                        accountId = Integer.parseInt(account.getId());
                      }else{
                        isCancel = true;
                      }
                    } else if (accounts.size() == 1) {
View Full Code Here

            public void handleEvent(Event arg0) {
                TableItem[] itens = accountsTable.getSelection();
                if (itens.length > 0) {
                  try {
                    String nameAccount = accountsTable.getSelection()[0].getText(1);
            Account account = (Account) system.query(new GetAccountByName(nameAccount));
            new AccountDialog(getParent().getShell(), getMySelf(), account).open();
          } catch (Exception e) {
            logger.error("GetAccountByName Exception: ", e);
          }
                }else{
                    setErrorMessage("Voc� deve selecionar uma conta para editar.");
                }
            }
        });

        data = new FormData();
        data.top = new FormAttachment(addAccountButton, 5);
        data.right = new FormAttachment(100, -10);
        data.width = 80;
        editAccountButton.setLayoutData(data);

        transferAccountButton = new Button(area.getComponentsComposite(), SWT.PUSH);
        transferAccountButton.setText("Transfer�ncia");
        transferAccountButton.setEnabled(system.hasAccess("Transfer�ncia de Contas"));
        transferAccountButton.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event arg0) {
                try {
                    TableItem[] itens = accountsTable.getSelection();
                    if (itens.length > 0) {
                        Account account = (Account) system.query(new GetAccountByName(accountsTable.getSelection()[0].getText(1)));
                        if(account.isActive())
                            new TransferBetweenAccountsDialog(getParent().getShell(), getMySelf(), accountsTable.getSelection()[0].getText(0)).open();
                        else
                            setErrorMessage("Voc� deve selecionar uma conta ativa.");
                    }else{
                        setErrorMessage("Selecione uma conta para efetuar uma transfer�ncia.");
                    }
                } catch (Exception e) {
                    logger.error("GetAccountByName exception: ", e);
                }
            }
        });

        data = new FormData();
        data.top = new FormAttachment(editAccountButton, 5);
        data.right = new FormAttachment(100, -10);
        data.width = 80;
        transferAccountButton.setLayoutData(data);
       
        extractAccountButton = new Button(area.getComponentsComposite(), SWT.PUSH);
        extractAccountButton.setText("Movimenta��o");
        extractAccountButton.setEnabled(system.hasAccess("Movimenta��o de Contas"));
       
        extractAccountButton.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event arg0) {
                try {
                    Account account = (Account) system.query(new GetAccountByName(accountsTable.getSelection()[0].getText(1)));
                    GDWindowControl.getInstance().openFlowBankAccountControlCenter(account);
                } catch (Exception e) {
                    logger.error("GetAccountByName Exception: ",e);
                }
            }
View Full Code Here

        });
       
        accountsTable.addListener(SWT.Selection, new Listener(){
            public void handleEvent(Event arg0) {
                try {
                    Account selectedAccount = (Account) system.query(new GetAccountByName(accountsTable.getSelection()[0].getText(1)));
                    extractAccountButton.setEnabled((selectedAccount.isBankAccount()));
                } catch (Exception e) {
                   logger.error("GetAccountByName Exception: ",e);
                }
            }
View Full Code Here

        incomingAccountCombo.setLayoutData(data);
       
        incomingAccountCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        try {
          Account account = (Account) system.query(new GetAccountByName(incomingAccountCombo.getText()));
          paymentTypeCombo.update(account);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here

                  }
                }
                if(accountSelected.equals(accountNameLogged)){
                  new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                } else {
                  Account accountDestiny = (Account) system.query(new GetAccountByName(accountSelected));
                  accountId = accountDestiny.getId();
                  if(!accountDestiny.isBankAccount()) {
                    User user = ((User)accountDestiny.getPerson().getPersonType("user"));
                    ConfirmUserAndPasswordDialog dialog = new ConfirmUserAndPasswordDialog(getShell(), user);
                    dialog.open();
View Full Code Here

        }
    }

    public void transferMoneyBetweenAccounts(String tranferMoneyToAccount, Account moneyFromAccount, Money transferValue) {
        try {
            Account accountToTransferMoney = (Account) system.query(new GetAccountByName(tranferMoneyToAccount));

            system.executeAndQuery(new AddAndReturnOperation(accountToTransferMoney, ((BillCategory) system.query(new GetBillCategory("Transfer�ncia entre contas"))).getId(), new GDDate(), "Tranfer�ncia da conta: "+ moneyFromAccount.getName(), transferValue.getFloatValue(), new PaymentMoney()));
            system.execute(new AccountAmountControl(accountToTransferMoney, transferValue, new Money(0)));
           
            system.executeAndQuery(new AddAndReturnOperation(moneyFromAccount, ((BillCategory) system.query(new GetBillCategory("Transfer�ncia entre contas "))).getId(), new GDDate(), "Tranfer�ncia para conta: "+ accountToTransferMoney.getName(), transferValue.getFloatValue(), new PaymentMoney()));
View Full Code Here

      close();
    }
   
    public void setAccount(String accountName) {
      try {
      account = (Account) system.query(new GetAccountByName(accountName));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

          paymentType = new PaymentDOC();
        } else if (combo.getText().equals("Saque cart�o")) {
          paymentType = new PaymentGetMoney();
        } else if (combo.getText().contains("Dep�sito na conta")) {
          try {
            Account account = (Account) system.query(new GetAccountByName(combo.getText().split("Dep�sito na conta ")[1]));
            paymentType = new PaymentBankAccountPayed(account);
          } catch (Exception e) {
            e.printStackTrace();
          }
        }
View Full Code Here

        accountCombo.setLayoutData(data);
       
        accountCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        try {
          Account account = (Account) system.query(new GetAccountByName(accountCombo.getText()));
          paymentTypeCombo.update(account);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
View Full Code Here

TOP

Related Classes of br.com.visualmidia.persistence.GetAccountByName

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.