if("add".equals(method)){
String priceYear=request.getParameter("priceYear");
String priceValue=request.getParameter("priceValue");
String priceMemo=request.getParameter("priceMemo");
if(new TbPriceDAO().add(new TbPrice(priceYear,priceValue,priceMemo,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "添加成功");
}else{
request.getSession().setAttribute("result", "添加失败");
}
request.getSession(true).setAttribute("tbPriceList",new TbPriceDAO().getTbPriceAll());
response.sendRedirect("PriceModule/TbPriceList.jsp");
}
if("del".equals(method)){
if(UtilDAO.delin("Tb_Price", "PriceId", request.getParameter("delIds"))){
request.getSession().setAttribute("result", "删除成功");
}else{
request.getSession().setAttribute("result", "删除失败");
}
request.getSession(true).setAttribute("tbPriceList",new TbPriceDAO().getTbPriceAll());
response.sendRedirect("PriceModule/TbPriceList.jsp");
}
if("edit".equals(method)){
int priceId=Integer.parseInt(request.getParameter("priceId"));
String priceYear=request.getParameter("priceYear");
String priceValue=request.getParameter("priceValue");
String priceMemo=request.getParameter("priceMemo");
if(new TbPriceDAO().edit(new TbPrice(priceId,priceYear,priceValue,priceMemo,new UtilDAO().decodeDate()))){
request.getSession().setAttribute("result", "修改成功");
}else{
request.getSession().setAttribute("result", "修改失败");
}
request.getSession(true).setAttribute("tbPriceList",new TbPriceDAO().getTbPriceAll());