}else{
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
close();
}
}else{
Group groupAdmin = (Group) system.query(new GetGroup("Administrador"));
ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), groupAdmin.getPeopleInThisGroup());
dialogConfirmAccountSource.open();
if(dialogConfirmAccountSource.isCheckPassword()) {
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}
close();
}
}else if(!moneyFromAccount.isBankAccount() && accountDestiny.isBankAccount()){
if(moneyFromAccount.getPerson().getId().equals(personLogged.getId())){
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}else{
boolean isOk = false;
boolean passwordIsOk = false;
if(moneyFromAccount.getId().equals(personLogged.getId())){
isOk = true;
}else{
User userAccountSource = ((User)moneyFromAccount.getPerson().getPersonType("user"));
ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), userAccountSource);
dialogConfirmAccountSource.open();
passwordIsOk = dialogConfirmAccountSource.isCheckPassword();
}
if(passwordIsOk || isOk) {
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}
}
close();
}else if(moneyFromAccount.isBankAccount() && accountDestiny.isBankAccount()){//Conta Banco para Conta Banco
if(isAdmin(personLogged)){
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}else{
Group groupAdmin = (Group) system.query(new GetGroup("Administrador"));
ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), groupAdmin.getPeopleInThisGroup());
dialogConfirmAccountSource.open();
if(dialogConfirmAccountSource.isCheckPassword()) {
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}