📄 insertproduction.jsp
字号:
<%@ taglib prefix="task" uri="/jsp/tld/WuYangTag.tld" %>
<jsp:useBean id="production" class="src.wuyang.Production" scope="page"/>
<jsp:useBean id="global" class="src.com.MyGlobal" scope="session"/>
<% if (global.isLogined == false) {
%>
<jsp:forward page="../pub/DBErr.jsp" >
<jsp:param name="rtcode" value="-4" />
</jsp:forward>
<% }
%>
<html>
<head>
<title>产品信息</title>
<script language ="javascript" src='../pub/pub.js' type=text/javascript></script>
<link rel="stylesheet" href="css.css" type="text/css">
</head><body bgcolor=#949B93>
<script language="JavaScript">
function VerifyInput(e){
if(isEmpty(e.productId.value)){
alert("请输入产品编号");
e.productId.focus();
return false;
}
if(isEmpty(e.productName.value)){
alert("请输入产品名称");
e.productName.focus();
return false;
}
if(isEmpty(e.classId.value))
{
alert("请选择产品类");
e.classId.focus();
return false;
}
if(isEmpty(e.unit.value))
{
alert("请输入单位");
e.unit.focus();
return false;
}
}
</script>
<%! String mode;%>
<%
mode = request.getParameter("mode");
if (request.getParameter("insert")!=null && mode.equals("insert") ){
production.setGlobal(global);
%>
<jsp:setProperty name="production" property="*" />
<%
int rtcode = production.insert();
if(rtcode >= 0) {
%>
<jsp:forward page="InsertProduction.jsp" >
<jsp:param name="mode" value="ok" />
</jsp:forward>
<%
}else {
%>
<jsp:forward page="../pub/DBErr.jsp" >
<jsp:param name="rtcode" value="<%= rtcode %>" />
</jsp:forward>
<%
}
}
if (mode!= null && mode.equals("ok")){
%>
<span class="title">记录插入成功!!</span>
<%
}
%>
<table width="100%" border="1" height="90%" bordercolorlight="#616860" bordercolordark="#CCCCCC" bgcolor="#4c7171" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<blockquote><br>
<br>
<form method="post" onsubmit="return VerifyInput(this)">
<input type="hidden" name="mode" value="insert"/>
<table width="44%" border="0" align="left" class="textb">
<tr>
<td width="34%"><b>产品编号: </b></td>
<td width="66%">
<input type="text" name="productId" />
</td>
</tr>
<tr>
<td width="34%"><b>产品名称:</b></td>
<td width="66%">
<input type="text" name="productName" />
</td>
</tr>
<tr>
<td width="34%"><b>产品英文名:</b></td>
<td width="66%">
<input type="text" name="productEName" />
</td>
</tr>
<tr>
<td width="34%"><b>产品类别:</b></td>
<td width="66%">
<select name="classId">
<task:productClass showType="select"/>
</select>
</td>
</tr>
<tr>
<td width="34%"><b>产品描述:</b></td>
<td width="66%">
<input type="text" name="productDesc" />
</td>
</tr>
<tr>
<td width="34%"><b>产品产地:</b></td>
<td width="66%">
<input type="text" name="productAddress" />
</td>
</tr>
<tr>
<td width="34%"><b>产品单位:</b></td>
<td width="66%">
<input type="text" name="unit" />
</td>
</tr>
<tr>
<td width="34%"><b>安全库存量:</b></td>
<td width="66%">
<input type="text" name="attenQuantity" />
</td>
</tr>
<tr>
<td width="34%"><b>主营部门:</b></td>
<td width="66%">
<select name="deptId">
<task:dept showType="select"/>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center"> <br>
<input type="submit" name="insert" value="新增" />
<input type="reset" value="重置" name="reset" />
</div>
</td>
</tr>
</table>
</form>
</blockquote>
</td>
</tr>
</table>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -