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

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

      addNew = true;
    }
  }
示例#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;
  }
示例#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());
    }
  }
示例#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);
    }
  }
示例#6
0
 public String cancelNewRole() {
   roleSysNewHome.clearInstance();
   init();
   return "cancel";
 }
示例#7
0
 public void prepareNewRole(String groupCode, String roleType) {
   roleSysNewHome.clearInstance();
   roleSysNewHome.getInstance().setGroupCode(groupCode);
   roleSysNewHome.getInstance().setRoleType(roleType);
   addNew = true;
 }