// 保存修改策略 public String updateStrategy() { int id = getParaIntValue("id"); String name = getParaValue("name"); String description = getParaValue("description"); int type = getParaIntValue("type"); int violateType = getParaIntValue("violateType"); String[] temp = getParaArrayValue("checkbox"); StringBuffer ids = new StringBuffer(); if (temp != null) { for (int i = 0; i < temp.length; i++) { ids.append(temp[i] + ","); } } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(); User user = (User) session.getAttribute(SessionConstant.CURRENT_USER); CompStrategy vo = new CompStrategy(); vo.setId(id); vo.setName(name); vo.setDescription(description); vo.setType(type); vo.setViolateType(violateType); vo.setGroupId(ids.toString()); vo.setLastModifiedBy(user.getName()); vo.setLastModifiedTime(sdf.format(date)); CompStrategyDao dao = new CompStrategyDao(); dao.update(vo); return null; }
// 修改策略 public String editStrategy() { String id = getParaValue("id"); CompGroupRuleDao dao = new CompGroupRuleDao(); List list = dao.loadAll(); CompStrategyDao strategyDao = new CompStrategyDao(); CompStrategy vo = (CompStrategy) strategyDao.findByID(id); request.setAttribute("list", list); request.setAttribute("vo", vo); return "/config/vpntelnet/compliance/editStrategy.jsp"; }
// 删除策略 public String deleteStrategy() { String[] ids = getParaArrayValue("checkbox"); if (ids != null && ids.length > 0) { CompStrategyDao dao = new CompStrategyDao(); try { dao.delete(ids); } catch (Exception e) { e.printStackTrace(); } finally { dao.close(); } } return strategyList(); }
public String strategyList() { CompStrategyDao dao = new CompStrategyDao(); List list = dao.loadAll(); request.setAttribute("list", list); return "/config/vpntelnet/compliance/strategyList.jsp"; }