Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Group


    public List<Group> getGroups() {
        List<Group> userGroups = new ArrayList<Group>();
        TreeItem[] treeItems = treeGroup.getItems();
        try {
            for (int i = 0; i < treeItems.length; i++) {
                Group group = (Group) system.query(new GetGroup(treeItems[i].getText()));
                userGroups.add(group);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here


    @SuppressWarnings("unchecked")
    public void updateGroupTable() {
        try {
            if (groupSelected != null) {
                Group group = (Group) system.query(new GetGroup(groupSelected));
                TreeItem item = new TreeItem(treeGroup, SWT.NONE);
                item.setImage(new Image(null, "img/groupsFolder.png"));
                item.setText(group.getNameGroup());

                for (String permission : group.getPermissions()) {
                    TreeItem screenItem = new TreeItem(item, SWT.NONE);
                    screenItem.setImage(new Image(null, "img/userScreenIco.png"));
                    screenItem.setText(permission);
                }
            }
View Full Code Here

    private void addGroupToTree() {
        try {
            TableItem[] seletion = groupTable.getSelection();

            if(!seletion[0].equals("")){
                Group group = (Group) system.query(new GetGroup(seletion[0].getText()));
                TreeItem item = new TreeItem(groupsTree, SWT.NONE);
                item.setImage(new Image(null, "img/groupsFolder.png"));
                item.setText(seletion[0].getText());
   
                for (String permission : group.getPermissions()) {
                    TreeItem screenItem = new TreeItem(item, SWT.NONE);
                    screenItem.setImage(new Image(null, "img/userScreenIco.png"));
                    screenItem.setText(permission);
                }
            }
View Full Code Here

    }

    private void updatePermissionTable(String groupSelected) {
        permissionTable.removeAll();
        try {
            Group group = (Group) system.query(new GetGroup(groupSelected));
            for (String permissions : group.getPermissions()) {
                TableItem permissionItem = new TableItem(permissionTable, SWT.NONE);
                permissionItem.setImage(new Image(null, "img/userScreenIco.png"));
                permissionItem.setText(permissions);
            }
        } catch (Exception e) {
View Full Code Here

      return false;
    }
   
    private List<Person> getAdministrators() {
    try {
      Group group = (Group) system.query(new GetGroup("Administrador"));
      List<Person> people = new ArrayList<Person>();
      for (Person user : group.getPeopleInThisGroup()) {
        people.add(user);
      }
      return people;
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

                    if (myDailyAccount.getPerson().getId().equals(loggedUser.getId())) {
                      TableItem item = new TableItem(accountTable, SWT.NULL);
                        item.setText(myDailyAccount.getName());
                        account.add(myDailyAccount);
                    } else {
                      Group group = (Group) system.query(new GetGroup("Administrador"));
                        for (Person person : group.getPeopleInThisGroup()) {
                            if (person.getId().equals(loggedUser.getId())) {
                              TableItem item = new TableItem(accountTable, SWT.NULL);
                              item.setText(myDailyAccount.getName());
                                account.add(myDailyAccount);
                                break;
View Full Code Here

        this.nameGroup = nameGroup;
        this.removePermission = removePermission;
    }

    protected void execute(PrevalentSystem system) throws BusinessException {
        Group group = system.groups.get(nameGroup);
        for (String permission : group.getPermissions()) {
            if (permission == removePermission) {
                group.removePermission(removePermission);
            }
        }
    }
View Full Code Here

                      }
                    } else if (accountDestiny.isBankAccount()) {
                      List<Person> administrators = new ArrayList<Person>();
                      Map<String, List<String>> groups = (Map<String, List<String>>) system.query(new GetGroup());
                      for (String groupName : groups.keySet()) {
                        Group group = (Group) system.query(new GetGroup(groupName));
                        if (group.getPeopleInThisGroup().size() > 0) {
                            List<Person> personUsers = group.getPeopleInThisGroup();
                            for (Person personUser : personUsers) {
                              if (group.getNameGroup().equals("Administrador")) {
                                administrators.add(personUser);
                              }
                            }
                        }
                      }
View Full Code Here

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

        this.nameGroup = nameGroup;
        this.userId = user.getId();
    }
   
    protected void execute(PrevalentSystem system) throws BusinessException {
    Group group = system.getGroups().get(nameGroup);
    if(group != null){
      for (Person person : group.getPeopleInThisGroup()) {
        if(person.getId().equals(userId)){
          return;//se o usu�rio ja existir no grupo n�o fa�a mais nada (return)
        }
      }
     
      Person personOfPersistence = system.getPeople().get(userId);
      if(personOfPersistence != null)//se o id do person existir adicione
        group.addUser(personOfPersistence);
    }
    }
View Full Code Here

TOP

Related Classes of br.com.visualmidia.business.Group

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.