@Override public BusinessResult updateLeaf(BeanContext origBean, BeanContext newBean) { VolunteerTrainCourseBusiness vtcb = (VolunteerTrainCourseBusiness) SingleBusinessPoolManager.getBusObj(BusTieConstant.BUS_CPATH_VOLUNTEERTRAINCOURSE); BusinessResult result = super.updateLeaf(origBean, newBean); TrainCourseBean bean = (TrainCourseBean) newBean; vtcb.updateCourseName(bean.getId(), bean.getName()); return result; }
@Override public BusinessResult deleteLeaf(String objectId) { VolunteerTrainCourseBusiness vtcb = (VolunteerTrainCourseBusiness) SingleBusinessPoolManager.getBusObj(BusTieConstant.BUS_CPATH_VOLUNTEERTRAINCOURSE); // 检查培训记录表 Map<String, String> filter = new HashMap<String, String>(); filter.put("traincourseId_=", objectId); List list = vtcb.queryDataByCondition(filter, null); if (list.size() > 0) { throw new MiServerException.Conflicted("该课程已经被培训记录关联,请先解除关联关系"); } return super.deleteLeaf(objectId); }