private void delete(int row) {
        if (!MyFactory.getResourceService().hasRight(MyFactory.getCurrentUser(), Resource.CONSUMPTION_W)) {
            return;
        }
        Consumption selectedRow = result == null ? null : result.get(row);
        if (selectedRow != null) {
            if (JOptionPane.showConfirmDialog(null, "确定要删除？") == JOptionPane.OK_OPTION) {
                if (MyFactory.getConsumptionService().delete(selectedRow.getId())) {
                    JOptionPane.showMessageDialog(null, "删除成功！");
                    refreshData();
                }
            }
        }
    }