@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()); } }
// Ajax public void prepareEditRole(RoleSys role) { if (role != null) { roleSysNewHome.setInstance(role); roleSysNewHome.wire(); addNew = true; } }
@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; }
// 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()); } }
// 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); } }
public String cancelNewRole() { roleSysNewHome.clearInstance(); init(); return "cancel"; }
public void prepareNewRole(String groupCode, String roleType) { roleSysNewHome.clearInstance(); roleSysNewHome.getInstance().setGroupCode(groupCode); roleSysNewHome.getInstance().setRoleType(roleType); addNew = true; }