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);
}
}
close();
}else {//Conta caixa para conta caixa
boolean isOk = false;
boolean passwordIsOk = false;
User userAccountSource = ((User)moneyFromAccount.getPerson().getPersonType("user"));
if(moneyFromAccount.getPerson().getId().equals(personLogged.getId())){
isOk = true;
}else{
ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), userAccountSource);
dialogConfirmAccountSource.open();
passwordIsOk = dialogConfirmAccountSource.isCheckPassword();
}
if(isOk || passwordIsOk) {
if(accountDestiny.getPerson().getId().equals(personLogged.getId())){
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
}else{
User userAccountDestiny = ((User)accountDestiny.getPerson().getPersonType("user"));
ConfirmUserAndPasswordDialog dialogConfirmDestiny = new ConfirmUserAndPasswordDialog(getShell(), userAccountDestiny);
dialogConfirmDestiny.open();
if(dialogConfirmDestiny.isCheckPassword()) {
new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);