delproduct.jsp

来自「java 数据库编程源代码」· JSP 代码 · 共 36 行

JSP
36
字号
<%
/**
 * Title:			商店购物管理系统的完整实现
 * Description:			教学示范
 * Copyright:			Copyright (c) 2003
 * Company:			北京师范大学计算机系
 * @author			孙一林
 * @version			1.0
 */
%>
<%@ page contentType="text/html; charset=GBK" %>
<html>
<%@ page import="java.sql.*"%>
<jsp:useBean id="shopManageBean" scope="session" class="shopmanagesystem.shopManageSystemBean"/>  <%/*使用shopManageSystemBean的实例*/%>
<head>
<title>删除售出商品记录</title>
</head>
<body>
<%
  int product_id = Integer.parseInt(new String(request.getParameter("delProductID").getBytes("8859_1")));  //获取用户指定删除的库存商品的ID号
  boolean isExisted = shopManageBean.isProductExistedInOtherTable(product_id);           //判断卖出商品表和顾客交易表中是否存在涉及到此库存商品的信息
  if(isExisted)            //若卖出商品表和顾客交易表中存在涉及到此库存商品的信息,则不能删除此库存商品的信息
  {
    out.println("<h2 align=center>其它表中仍存在此商品的信息,请首先删除其他表中此商品的信息</h2>");
    out.println("<p align=center><a href=productList.jsp>返回</a></p>");
  }
  else                   //若不存在,则删除此库存商品信息
  {
    shopManageBean.delProduct(product_id);
    out.println("<h2 align=center>删除售出商品记录成功</h2>");
    out.println("<p align=center><a href=productList.jsp>返回</a></p>");
  }
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?