@Override public boolean canDelete() throws JxException { boolean b = super.canDelete(); if (b) { JboSetIFace childDeptSet = getRelationJboSet("PUB_DEPARTMENTSUPER_DEPARTMENT_IDP"); List<JboIFace> childs = childDeptSet.getJbolist(); if (childs.isEmpty()) { JboSetIFace deptUserJboSet = getRelationJboSet("PUB_USERDEPARTMENT_IDP"); if (!deptUserJboSet.getJbolist().isEmpty()) { throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.DEL.HASUSER")); } } else { for (int i = 0; i < childs.size(); i++) { JboIFace jbo = childs.get(i); JboSetIFace deptUserJboSet = jbo.getRelationJboSet("PUB_USERDEPARTMENT_IDP"); if (!deptUserJboSet.getJbolist().isEmpty()) { getJboSet().rollback(); throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.DEL.HASUSER")); } else { jbo.delete(); } } } } return b; }
private boolean hasNoneActiveDept(List<JboIFace> deptList) throws JxException { int size = deptList.size(); for (int i = 0; i < size; i++) { JboIFace dept = deptList.get(i); if ("1".equals(dept.getString("STATE"))) { throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.HAS_ACTIVE_DEPT")); } } return true; }
private boolean hasNoneActiveUser(List<JboIFace> userList) throws JxException { int size = userList.size(); for (int i = 0; i < size; i++) { JboIFace user = userList.get(i); if ("1".equals(user.getString("ACTIVE"))) { throw new JxException(JxLangResourcesUtil.getString("app.pubdepartment.HAS_ACTIVE_USER")); } } return true; }
@Override public void evaluateParams() { super.evaluateParams(); if (jboname != null) { addParameter("jboname", findString(jboname).toUpperCase()); } if (relationship != null) { addParameter("relationship", findString(relationship).toUpperCase()); } if (wherecause != null) { addParameter("wherecause", findString(wherecause)); } if (options != null) { addParameter("options", findString(options)); } if (dataattribute != null) { addParameter("dataattribute", findString(dataattribute).toUpperCase()); } if (readonly != null) { addParameter("readonly", findValue(readonly, Boolean.class)); } if (inputmode != null) { String im = findString(inputmode).toUpperCase(); addParameter("inputmode", im); if ("READONLY".equals(im)) { addParameter("readonly", true); } } if (parentName != null) { addParameter("parentName", findString(parentName).toUpperCase()); } if (displayname != null) { addParameter("displayname", findString(displayname).toUpperCase()); } if (mystyle != null) { addParameter("mystyle", findString(mystyle).toUpperCase()); } if (orderby != null) { addParameter("orderby", findString(orderby)); } if (partialTriggers != null) { addParameter("partialTriggers", findString(partialTriggers)); } if (selected != null) { addParameter("selected", findString(selected)); } if (selectedDisplay != null) { addParameter("selectedDisplay", selectedDisplay); } if (selectedJbo != null) { addParameter("selectedJbo", selectedJbo); } if (displayvalue != null) { addParameter("displayvalue", findString(displayvalue).toUpperCase()); } if (partialCause != null) { addParameter("partialCause", findString(partialCause)); } addParameter("sql", sql); if (cause != null) { addParameter("cause", findString(cause)); } if (null != visible) { addParameter("visible", findValue(visible, Boolean.class)); } if (null != required) { addParameter("required", findValue(required, Boolean.class)); } if (null != colspan) { addParameter("colspan", findString(colspan)); } if (null != width) { addParameter("width", findString(width)); } if (null != label) { addParameter("label", getI18NValue(label)); } addParameter("optionsList", optionsList); addParameter("jboset", jboset); if (!StrUtil.isNull(appName)) { addParameter( "appBundle", JxLangResourcesUtil.getResourceBundle("res.app." + appName.toLowerCase())); } if (null != cssClass) { dynamicAttributes.put("cssClass", findString(cssClass)); } if (null != render) { addParameter("render", findString(render)); } if (null != renderExtends) { addParameter("renderExtends", findString(renderExtends)); } if (null != renderParam) { addParameter("renderParam", findString(renderParam)); } if (null != multiple) { addParameter("multiple", findValue(multiple, Boolean.class)); } if (null != ajax) { String aj = findString(ajax); if (aj != null) { if (aj.indexOf('\'') < 0 && aj.indexOf('"') < 0) { aj = "\"" + aj + "\""; } } addParameter("ajax", aj); } if (optionsCount > 0) { addParameter("optionsCount", optionsCount); } }