?? delproduct.jsp
字號:
<%
/**
* 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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -