if("add".equals(method)){
String interfaceCode=request.getParameter("interfaceCode");
String interfaceName=request.getParameter("interfaceName");
String interfactMemo=request.getParameter("interfactMemo");
if(new TbInterfaceDAO().add(new TbInterface(interfaceCode,interfaceName,interfactMemo,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbInterfaceList",new TbInterfaceDAO().getTbInterfaceAll());
response.sendRedirect("InterfaceModule/TbInterfaceList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_Interface", "InterfaceId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbInterfaceList",new TbInterfaceDAO().getTbInterfaceAll());
response.sendRedirect("InterfaceModule/TbInterfaceList.jsp");
}
if("edit".equals(method)){
int interfaceId=Integer.parseInt(request.getParameter("interfaceId"));
String interfaceCode=request.getParameter("interfaceCode");
String interfaceName=request.getParameter("interfaceName");
String interfactMemo=request.getParameter("interfactMemo");
if(new TbInterfaceDAO().edit(new TbInterface(interfaceId,interfaceCode,interfaceName,interfactMemo,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbInterfaceList",new TbInterfaceDAO().getTbInterfaceAll());