if("add".equals(method)){
int productId=Integer.parseInt(request.getParameter("productId"));
int priceId=Integer.parseInt(request.getParameter("priceId"));
int userId=Integer.parseInt(request.getParameter("userId"));
if(new TbProductPriceMiddleDAO().add(new TbProductPriceMiddle(productId,priceId,userId))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbProductPriceMiddleList",new TbProductPriceMiddleDAO().getTbProductPriceMiddleAll());
response.sendRedirect("ProductpricemiddleModule/TbProductPriceMiddleList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_ProductPriceMiddle", "ProductPriceMiddleId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbProductPriceMiddleList",new TbProductPriceMiddleDAO().getTbProductPriceMiddleAll());
response.sendRedirect("ProductpricemiddleModule/TbProductPriceMiddleList.jsp");
}
if("edit".equals(method)){
int productPriceMiddleId=Integer.parseInt(request.getParameter("productPriceMiddleId"));
int productId=Integer.parseInt(request.getParameter("productId"));
int priceId=Integer.parseInt(request.getParameter("priceId"));
int userId=Integer.parseInt(request.getParameter("userId"));
if(new TbProductPriceMiddleDAO().add(new TbProductPriceMiddle(productPriceMiddleId,productId,priceId,userId))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbProductPriceMiddleList",new TbProductPriceMiddleDAO().getTbProductPriceMiddleAll());