📄 delconsignitem.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="TeaWeb.*"%>
<%@page import="TeaWeb.PurcharItemDetail"%>
<%@page import="TeaWeb.PurcharDetail"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>天缘茗茶</title>
<LINK href="TeaWebCSS.css" type=text/css rel=stylesheet />
<script language="javascript">
function goto(url)
{
document.location = url;
}
</script>
</head>
<body topmargin="0" leftmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="60" colspan="3"><%@ include file="head.jsp" %></td>
</tr>
<tr>
<td width="180" rowspan="2" align="right" valign="top"><%@ include file="left.jsp" %></td>
<td height="6" colspan="2" background="Images/TopLine.jpg"></td>
</tr>
<tr>
<td width="5" height="600" align="left" valign="top"><img src="Images/Corner.jpg" width="5" height="5" /></td>
<td width="100%" align="center" valign="top"><table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30">
</td>
</tr>
</table>
<%
try
{
request.setCharacterEncoding("gb2312");
String index = request.getParameter("id");
int iPos = -1;
if (index == null)
{
iPos = -1;
}
else
{
try
{
iPos = Integer.parseInt(index);
}
catch(Exception ex)
{
iPos = -1;
}
}
//把记录添加到临时会话变量中
PurcharDetail pd = (PurcharDetail)session.getAttribute("Purchase");
//获取临时存放在session对象中的数据
//要删除必须满足三个条件:
//1、必须会话中有保存
//2、产品的数量比要删除的位置大
//3、删除的位置正确
//pd.Product.size()-1是总的列表数iPos是当前的列表位置
if ((pd!=null) && ((pd.Product.size()-1) >= iPos) && (iPos >= 0))
{
pd.Product.remove(iPos);//删除指定位置的列表
session.setAttribute("Purchase",pd);
}
out.print("<script language='javascript'>");
out.print("document.location = 'Purchase.jsp';");
out.print("</script>");
}
catch(Exception ex)
{
out.print(ex.getMessage());
}
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -