Example #1
0
  @Transactional
  public void deleteRole(RoleSys role) {

    try {

      if (role != null && role.getRoleId() != 0) {
        roleSysNewHome.clearInstance();
        roleSysNewHome.setRoleNewHomeId(role.getRoleId());
        roleSysNewHome.wire();

        String entityAction = roleSysNewHome.remove();

        if (entityAction.equalsIgnoreCase("removed")) {

          facesMessages.clear();
          facesMessages.clearGlobalMessages();
        }

        roleSysNewHome.clearInstance();

        // staffHome.refresh();

      }

    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
  }
Example #2
0
  @Transactional
  public void deleteFunction(RoleSys role, Function function) {

    try {

      if (role != null && function != null) {

        roleSysHome.clearInstance();
        roleSysHome.setRoleHomeId(role.getRoleId());
        roleSysHome.wire();
        roleSysHome.getInstance().getFunctions().remove(function);

        String entityAction = roleSysHome.update();

        if (entityAction.equalsIgnoreCase("updated")) {

          facesMessages.clear();
          facesMessages.clearGlobalMessages();
        }

        roleSysHome.createInstance();
      }

    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
  }
Example #3
0
  public String loadRole(RoleSys role) {
    String returnString = "";

    try {
      if (role != null && role.getRoleId() != 0) {
        roleSysHome.clearInstance();
        roleSysHome.setRoleHomeId(role.getRoleId());
        roleSysHome.wire();

        returnString = "role-loaded";
      }

    } catch (Exception e) {
      log.error(e.getMessage());
      System.out.println(e.getMessage());
    }

    return returnString;
  }