?? stockpile_add.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=DataBase/conn.asp-->
<!--#include file=config.asp-->
<!--#include file=purview.asp-->
<%
call stockpile
if request("post")<>"" then
'入庫
set rsru=server.CreateObject("adodb.recordset")
rsru.open "select sum(StockpileProductNumber) as ru from tb_Stockpile where StockpileType='入庫' and StockpileProductName="&request("StockpileProductName") ,conn,1,1
ru=rsru("ru")
if isnull(ru) then
ru=0
end if
'出庫
set rschu=server.CreateObject("adodb.recordset")
rschu.open "select sum(StockpileProductNumber) as chu from tb_Stockpile where StockpileType='出庫' and StockpileProductName="&request("StockpileProductName") ,conn,1,1
chu=rschu("chu")
if isnull(chu) then
chu=0
end if
sheng=ru-chu
if request("StockpileType")="出庫" then
if int(request("StockpileProductNumber"))>sheng then
response.Write("<script language=javascript>alert('出庫數(shù)量不能大于庫存');location='javascript:history.go(-1)'</script>")
response.End()
end if
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from tb_Stockpile"
rs.open sql,conn,1,3
rs.addnew
rs("StockpileProductName")=trim(request("StockpileProductName"))
rs("StockpileProductNumber")=trim(request("StockpileProductNumber"))
rs("StockpileType")=trim(request("StockpileType"))
rs("StockpileContent")=request("StockpileContent")
rs("SetTime")=date()
rs("SetName")=session("admin_name")
rs.update
rs.close
response.Write("<script language=javascript>alert('庫存信息添加成功')</script>")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標(biāo)題文檔</title>
<style type="text/css">
<!--
body {
background-color: #DFEEFF;
}
body,td,th {
font-size: 12px;
}
-->
</style>
<link href="css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
</head>
<script language="javascript">
function checks()
{
if(form1.StockpileProductName.value=="")
{
alert("請先添加產(chǎn)品");
return false;
}
else if(form1.StockpileProductNumber.value=="")
{
alert("產(chǎn)品數(shù)量不能為空");
return false;
}
else if(isNaN(form1.StockpileProductNumber.value))
{
alert("產(chǎn)品數(shù)量必須是數(shù)字");
return false;
}
}
</script>
<body >
<form name="form1" method="post" action="">
<fieldset class="fiedset">
<legend>添加庫存信息</legend>
<table width="970" border="0" align="center" cellspacing="0" bgcolor="#FFFFFF" class="table">
<tr>
<td width="21%" height="30" align="right">產(chǎn)品編號:</td>
<td colspan="3" width="33%" > <%
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from tb_Product order by id desc"
rsc.open sqlc,conn,1,1
if not rsc.eof then
%>
<select name="StockpileProductName" class="table" id="StockpileProductName">
<%
for i=1 to rsc.recordcount and not rsc.eof
%>
<option value="<%=rsc("id")%>" selected><%=rsc("ProductNumber")%></option>
<%
rsc.movenext
next
%>
</select>
<%
else
response.Write("沒有客戶信息,請<a href='KeHu_add.asp' target='bo'>添加</a>")
end if
%>
<input name="post" type="hidden" id="post" value="true"></td>
<td width="10%" align="right"> </td>
<td width="37%" colspan="3"> </td>
</tr>
<tr>
<td height="30" align="right">產(chǎn)品數(shù)量:</td>
<td colspan="3"><input name="StockpileProductNumber" type="text" class="in" id="StockpileProductNumber" size="30"></td>
<td align="right">庫存類型:</td>
<td colspan="3"><select name="StockpileType" id="StockpileType">
<option value="入庫">入庫</option>
<option value="出庫">出庫</option>
</select></td>
</tr>
<tr>
<td height="30" align="right">庫存說明:</td>
<td colspan="7" rowspan="5"><textarea name="StockpileContent" cols="92" rows="9" class="table" id="StockpileContent">無</textarea></td>
</tr>
<tr>
<td height="30" align="right"> </td>
</tr>
<tr>
<td height="30" align="right"> </td>
</tr>
<tr>
<td height="30" align="right"> </td>
</tr>
<tr>
<td height="30" align="right"> </td>
</tr>
<tr align="center">
<td height="37" colspan="8"><input name="Submit" type="submit" class="input" value=" 添 加 " onClick="return checks()"></td>
</tr>
</table>
<table width="90%" height="5" border="0" align="center">
<tr>
<td></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -