public boolean delete(int id) { PaidDetail paidDetail = paidDao.find(id); boolean flag = paidDao.delete(id); if (flag) { log.debug(MyFactory.getUserService().getCurrentUserName() + " delete " + paidDetail); } return flag; }
public boolean censored(int id, boolean pass) { boolean flag; PaidDetail paidDetail = paidDao.find(id); paidDetail.setCensored(pass ? Constants.CENSORED_PASS : Constants.CENSORED_REFUSE); flag = paidDao.update(paidDetail); if (flag) { log.debug(MyFactory.getUserService().getCurrentUserName() + " censored " + paidDetail); } return flag; }
public boolean update(PaidDetail paidDetail) { int id = paidDetail.getId(); boolean flag = false; PaidDetail old = paidDao.find(id); if (MyFactory.getResourceService().hasRight(MyFactory.getCurrentUser(), Resource.CENSORED)) { paidDetail.setCensored(Constants.CENSORED_PASS); } else { paidDetail.setCensored(Constants.CENSORED_ORIGINAL); } if (flag) { log.debug( MyFactory.getUserService().getCurrentUserName() + " update " + old + " to " + paidDetail); } return flag; }