日期:2014-05-17 浏览次数:20710 次
td> <td> <a href="order_del_deal.jsp?ID=<%=OrderID%>"onclick="return confirm('真的要删?')">删</a></td>
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*" errorPage="" %> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> <%@ page import="com.wgh.dao.OrderDaoImpl"%> <jsp:useBean id="Order" scope="page" class="commerce.Order"> <jsp:setProperty name="Order" property="*"/> </jsp:useBean> <jsp:useBean id="chStr" scope="page" class="com.wgh.DB.chStr"/> <jsp:useBean id="conn" scope="page" class="com.wgh.DB.connDB"/> <jsp:include page="safe.jsp"/> <% //删除订单页面 Integer id=Order.getOrderID(); //这边为什么会id=-1 或者为null; -----传过来就是null的 System.out.println("删除id= "+id); ResultSet rs=conn.executeQuery("select * from tb_order where OrderID=" + id); //System.out.println(rs); if (!rs.next()){ out.println("<script language='javascript'>alert('您的操作有误');window.location.href='ordermanage.jsp';</script>"); }else{ int ret=0; OrderDaoImpl del_order=new OrderDaoImpl(); ret=del_order.delete(Order); if (ret!=0){ out.println("<script language='javascript'>alert('订单信息删除成功!');window.location.href='ordermanage.jsp';</script>"); }else{ out.println("<script language='javascript'>alert('订单信息删除失败!');window.location.href='ordermanage.jsp';</script>"); } } %>