String interfaceId=request.getParameter("interfaceId");
String areaId=request.getParameter("areaId");
int userId=Integer.parseInt(request.getParameter("userId"));
String productMemo=request.getParameter("productMemo");
//String createTime=request.getParameter("createTime");
if(new TbProductDAO().add(new TbProduct(productTypeId,productName,interfaceId,areaId,userId,productMemo,new UtilDAO().decodeDate() ))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbProductList",new TbProductDAO().getTbProductAll());
response.sendRedirect("ProductModule/TbProductList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_Product", "ProductId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbProductList",new TbProductDAO().getTbProductAll());
response.sendRedirect("ProductModule/TbProductList.jsp");
}
if("edit".equals(method)){
int productId=Integer.parseInt(request.getParameter("productId"));
int productTypeId=Integer.parseInt(request.getParameter("productTypeId"));
String productName=request.getParameter("productName");
String interfaceId=request.getParameter("interfaceId");
String areaId=request.getParameter("areaId");
int userId=Integer.parseInt(request.getParameter("userId"));
String productMemo=request.getParameter("productMemo");
String createTime=request.getParameter("createTime");
if(new TbProductDAO().edit(new TbProduct(productId,productTypeId,productName,interfaceId,areaId,userId,productMemo,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbProductList",new TbProductDAO().getTbProductAll());