Beispiel #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());
    }
  }
Beispiel #2
0
  // Ajax
  public void prepareEditRole(RoleSys role) {

    if (role != null) {
      roleSysNewHome.setInstance(role);
      roleSysNewHome.wire();

      addNew = true;
    }
  }
Beispiel #3
0
  @Transactional
  public String addNewRoleGroup() {
    String returnString = "";

    try {
      if (roleSysNewHome != null) {

        String entityAction = roleSysNewHome.persist();

        if (entityAction.equalsIgnoreCase("persisted")) {
          //
          returnString = "role-loaded";

          addNew = false;

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

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

    return returnString;
  }
Beispiel #4
0
  // Ajax Callback
  @Transactional
  public void updateNewRole() {

    try {
      if (roleSysNewHome != null) {

        String entityAction = roleSysNewHome.update();

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

          addNew = false;

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

    } catch (Exception e) {
      log.error(e.getMessage());
      System.out.println(e.getMessage());
    }
  }
Beispiel #5
0
  // Ajax Callback
  public void changeLetterCasingNew() {

    /*if(lookupItemHome != null
            && lookupItemHome.getInstance().getName() != null && !lookupItemHome.getInstance().getName().equalsIgnoreCase("")){
        lookupItemHome.getInstance().setName(toCamelCase(lookupItemHome.getInstance().getName()));
    }*/

    if (roleSysNewHome != null
        && roleSysNewHome.getInstance().getInternalCode() != null
        && !roleSysNewHome.getInstance().getInternalCode().equalsIgnoreCase("")) {

      String tempGroupCode = roleSysNewHome.getInstance().getInternalCode().toUpperCase();

      tempGroupCode = tempGroupCode.replaceAll("\\s+", "");

      roleSysNewHome.getInstance().setInternalCode(tempGroupCode);
    }

    if (roleSysNewHome != null
        && roleSysNewHome.getInstance().getGroupCode() != null
        && !roleSysNewHome.getInstance().getGroupCode().equalsIgnoreCase("")) {

      String tempGroupCode = roleSysNewHome.getInstance().getGroupCode().toUpperCase();

      tempGroupCode = tempGroupCode.replaceAll("\\s+", "");

      roleSysNewHome.getInstance().setGroupCode(tempGroupCode);
    }

    if (roleSysNewHome != null
        && roleSysNewHome.getInstance().getRoleType() != null
        && !roleSysNewHome.getInstance().getRoleType().equalsIgnoreCase("")) {

      String tempRoleType = roleSysNewHome.getInstance().getRoleType().toUpperCase();

      tempRoleType = tempRoleType.replaceAll("\\s+", "");

      roleSysNewHome.getInstance().setRoleType(tempRoleType);
    }
  }
Beispiel #6
0
 public String cancelNewRole() {
   roleSysNewHome.clearInstance();
   init();
   return "cancel";
 }
Beispiel #7
0
 public void prepareNewRole(String groupCode, String roleType) {
   roleSysNewHome.clearInstance();
   roleSysNewHome.getInstance().setGroupCode(groupCode);
   roleSysNewHome.getInstance().setRoleType(roleType);
   addNew = true;
 }