📄 goodsdetail.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*,java.lang.Double.*"%>
<%@include file="comm.jsp"%>
<html>
<SCRIPT language=javascript>
<!--
function datacheck()
{
if(frmGoodsUpdate.GoodsName.value=="")
{
window.alert("请输入商品名称");
document.frmGoodsUpdate.elements(0).focus();
return;
}
if(frmGoodsUpdate.GoodsTypeID.value==""||isNaN(frmGoodsUpdate.GoodsTypeID.value))
{
window.alert("请输入商品类型ID,且为数字");
document.frmGoodsUpdate.elements(1).focus();
return;
}
if(frmGoodsUpdate.Price.value==""||isNaN(frmGoodsUpdate.Price.value))
{
window.alert("请输入商品单价,且为数字");
document.frmGoodsUpdate.elements(2).focus();
return;
}
if(frmGoodsUpdate.NumNow.value==""||isNaN(frmGoodsUpdate.NumNow.value))
{
window.alert("请输入商品采购数量,且为数字");
document.frmGoodsUpdate.elements(3).focus();
return;
}
if(frmGoodsUpdate.NumHigh.value==""||isNaN(frmGoodsUpdate.NumHigh.value))
{
window.alert("请输入商品最高数量,且为数字");
document.frmGoodsUpdate.elements(3).focus();
return;
}
if(frmGoodsUpdate.NumLow.value=="" || isNaN(frmGoodsUpdate.NumLow.value))
{
window.alert("请输入商品最低数量,且为数字");
document.frmGoodsUpdate.elements(4).focus();
return;
}
frmGoodsUpdate.submit();
}
-->
</SCRIPT>
<body >
<div>
<table>
<tr>
<td width="236" align=center valign=top><br>
<p ><font color="#000080"><a href=SysuserInfo.jsp?action=mine>我的资料</a></font></p>
<p>类别信息
<br> <a href="TypeInfo.jsp?action=type_list">类别列表</a>
<br> <a href="TypeInsert.htm">添加类别</a></p>
<p>商品信息
<br> <a href="GoodsInfo.jsp?action=view&type=1">可用商品</a>
<br> <a href="GoodsInfo.jsp?action=view&type=2">过线商品</a>
<br> <a href="GoodsInsert.htm">添加商品</a></p>
<p>订单管理
<br> <a href="GoodsTrans.jsp?action=view&type=2">已提交</a>
<br> <a href="GoodsTrans.jsp?action=view&type=3">已发货</a></p>
</td>
<%
String SysuserID=(String)session.getValue("sysuser");
String SysuserType=(String)session.getValue("sysuserType");
String GoodsID=request.getParameter("GoodsID");
action=request.getParameter("action");
if(SysuserID==null||SysuserType.compareTo("商品管理员")!=0)
{
%>
<jsp:forward page="SysuserLogin.htm"/>
<%
}
if(action.equals("update"))
{
String GoodsName=request.getParameter("GoodsName");
String GoodsTypeID=request.getParameter("GoodsTypeID");
String Price=request.getParameter("Price");
String NumNow=request.getParameter("NumNow");
String NumHigh=request.getParameter("NumHigh");
String NumLow=request.getParameter("NumLow");
String GoodsDescr=request.getParameter("GoodsDescr");
strSql="{call dbo.sp_UpdateGoods(?,?,?,?,?,?,?,?,?)}";
cstmt=conn.prepareCall(strSql);
cstmt.setInt(1,Integer.parseInt(GoodsID));
cstmt.setString(2,GoodsName);
cstmt.setInt(3,Integer.parseInt(GoodsTypeID));
cstmt.setDouble(4,Double.parseDouble(Price));
cstmt.setInt(5,Integer.parseInt(NumNow));
cstmt.setInt(6,Integer.parseInt(NumHigh));
cstmt.setInt(7,Integer.parseInt(NumLow));
cstmt.setString(8,GoodsDescr);
cstmt.setString(9,SysuserID);
cstmt.executeUpdate();
}
strSql="{call dbo.sp_GetGoods(?)}";
cstmt=conn.prepareCall(strSql);
cstmt.setInt(1,Integer.parseInt(GoodsID));
rs=cstmt.executeQuery();
if(rs.next())
{
%>
<td>
<p align=center>欢迎您:<%=SysuserID%> (<%=SysuserType%>)</p>
<form method="POST" action="GoodsDetail.jsp?action=update&GoodsID=<%=GoodsID%>" name="frmGoodsUpdate">
<table align=center>
<tr bgcolor="#E9E9D1">
<td align=center width="89"> </td>
<td align=center width="337"> 查看商品 </td>
</tr>
<tr>
<td width="89">商品ID: </td>
<td width="337"><%=rs.getInt(1)%> </td>
</tr>
<tr bgcolor="#EAFfFff">
<td width="89">商品名:</td>
<td width="337"><input type="text" name="GoodsName" size="17"
value=<%=new String(rs.getString(2).getBytes("8859_1"),"gb2312")%>> * </td>
</tr>
<tr>
<td width="89">类型ID</td>
<td width="337"><input type="text" name="GoodsTypeID" size="13" value=<%=rs.getInt(3)%>>* </td>
</tr>
<tr bgcolor="#EAFfFff">
<td width="89">类型名称: </td>
<td width="337"><%=new String(rs.getString(4).getBytes("8859_1"),"gb2312")%></td>
</tr>
<tr >
<td width="89">单价:</td>
<td width="337"><input type="text" name="Price" size="13" value=<%=rs.getDouble(5)%>>*</td>
</tr>
<tr bgcolor="#EAFfFff">
<td width="89">当前数量:</td>
<td width="337"><input type="text" name="NumNow" size="13" value=<%=rs.getInt(6)%>>*</td>
</tr>
<tr >
<td width="89">最高数量:</td>
<td width="337"><input type="text" name="NumHigh" size="13" value=<%=rs.getInt(7)%>>*</td>
</tr>
<tr bgcolor="#EAFfFff">
<td width="89">最低数量:</td>
<td width="337"><input type="text" name="NumLow" size="13" value=<%=rs.getInt(8)%>>*</td>
</tr>
<tr >
<td width="89">商品描述:</td>
<td width="337"><input type="text" name="GoodsDescr" size="60"
value=<%=new String(rs.getString(9).getBytes("8859_1"),"gb2312")%>></td>
</tr>
<tr bgcolor="#EAFfFff">
<td width="89">更新时间: </td>
<td width="337"><%=rs.getDate(10)%></td>
</tr>
<tr >
<td width="89">操作人: </td>
<td width="337"><%=rs.getString(11)%></td>
</tr>
</table>
<table align=center><br>
<p><button type="none" class="button" onclick="datacheck()">修改提交</button>
<input type="reset" value="全部重写" name="B2"></p>
</table>
</form>
</td>
<%
}
rs.close();
cstmt.close();
conn.close();
%>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -