📄 assetsedit.asp
字号:
<!--#include file="../conndb.asp"-->
<html>
<head>
<title>编辑固定资产信息</title>
<link rel="stylesheet" href="../style.css">
<Script Language="JavaScript">
//域校验
function CheckFlds(){
if (document.form1.aid.value==""){
alert("请输入固定资产编号!");
form1.aid.focus;
return false;
}
if (document.form1.aname.value==""){
alert("请输入固定资产名称!");
form1.aname.focus;
return false;
}
if (document.form1.type.selectedIndex<0){
alert("请选择固定资产类别!");
form1.type.focus;
return false;
}
if (document.form1.atype.selectedIndex<0){
alert("请选择增加方式!");
form1.atype.focus;
return false;
}
if (document.form1.udate.value==""){
alert("请输入入账日期!");
form1.udate.focus;
return false;
}
if (document.form1.uyear.value==""){
alert("请输入使用年限!");
form1.uyear.focus;
return false;
}
if (document.form1.oprice.value==""){
alert("请输入资产原值!");
form1.oprice.focus;
return false;
}
return true;
}
</Script>
</head>
<%
Dim aId,aName,TypeId,aTypeId,Model,Producer,UseDate,UsedYear,OrgPrice,Ratio,Status,PostDate
Dim Action,rs
'变量初始化
UseDate = Date()
OrgPrice = 0
Ratio = 0.01
PostDate = Date()
Status = "创建"
'读取参数action\aid
Action = Request.QueryString("action")
aId = Request.QueryString("aid")
Set rs = Server.CreateObject("ADODB.RecordSet")
'编辑记录
If Action = "edit" Then
'设置SELECT语句,读取记录数据
sql = "SELECT * FROM AssetsInfo Where AId='" & aId & "'"
rs.Open sql,conn,1,3
If Not rs.EOF Then
aName = rs("AName")
TypeId = rs("TypeId")
aTypeId = rs("AddWayId")
Producer = rs("Producer")
Model = rs("Model")
UsedYear = rs("UsedYear")
UseDate = rs("UseDate")
OrgPrice = rs("OrgPrice")
Ratio = rs("Ratio")
PostDate = rs("PostDate")
End If
rs.Close()
End If
%>
<body leftmargin="1" topmargin="0">
<form name="form1" method="POST" action="AssetsSave.asp?action=<%=Action%>" onsubmit="return CheckFlds()">
<br>
<table align="center" border="1" cellspacing="0" width="95%" bordercolor="#64B9E1" bordercolorlight="#64B9E1" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#FFFFFF" colspan="4" background="pic/assets.jpg" height="90" width="100%">
<p align="center"><b><font face="华文彩云" color="#000080" size="6">固定资产基本信息</font></b></p>
</td>
</tr>
<tr>
<td bgcolor="#CEE7FF">资产编号</td>
<td><input type="text" name="aid" size="20" value="<%=aId%>" <%If Action = "edit" Then%>ReadOnly<%End If%>> </td>
<td bgcolor="#CEE7FF">资产名称</td>
<td><input type="text" name="aname" size="20" value="<%=aName%>" > </td>
</tr>
<tr>
<td width="20%" bgcolor="#CEE7FF">资产型号</td>
<td width="40%"><input type="text" name="model" size="20" value="<%=Model%>"></td>
<td width="20%" bgcolor="#CEE7FF">入账日期</td>
<td width="40%"><input type="text" name="udate" size="20" value="<%=UseDate%>"></td>
</tr>
<tr>
<td bgcolor="#CEE7FF">生产厂家</td>
<td colspan="3"><input type="text" name="producer" size="60" value="<%=Producer%>"></td>
</tr>
<tr>
<td width="20%" bgcolor="#CEE7FF">选择资产类别</td>
<td width="40%"><select size="1" name="type">
<%sql = "Select * From Types Where Flag=12 ORDER BY TypeId"
rs.Open sql,conn,1,3
Do While Not rs.EOF
If rs("TypeId")=TypeId Then
%>
<option selected value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
<%Else%>
<option value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
<%End If
rs.MoveNext()
Loop
rs.Close()%>
</select></td>
<td bgcolor="#CEE7FF">增加方式</td>
<td><select size="1" name="atype">
<%sql = "Select * From Types Where Flag=13 ORDER BY TypeId"
rs.Open sql,conn,1,1
Do While Not rs.EOF
If rs("TypeId")=aTypeId Then %>
<option selected value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
<%Else%>
<option value="<%=rs("TypeId")%>"><%=rs("TypeName")%></option>
<%End If
rs.MoveNext()
Loop
rs.Close()%>
</select></td>
</tr>
<tr>
<td bgcolor="#CEE7FF">资产原值</td>
<td><input type="text" name="oprice" size="20" value="<%=OrgPrice%>"> </td>
<td bgcolor="#CEE7FF">使用年限</td>
<td><input type="text" name="uyear" size="20" value="<%=UsedYear%>"> </td>
</tr>
<tr>
<td bgcolor="#CEE7FF">残值率</td>
<td><input type="text" name="ratio" size="20" value="<%=Ratio%>"> </td>
<td bgcolor="#CEE7FF">状态</td>
<td>创建</td>
</tr>
<tr>
<td bgcolor="#CEE7FF">录入日期</td>
<td colspan="3"><%=PostDate%> </td>
</tr>
</table>
<p align=center><input type="submit" value=" 提 交 " name="B1">
<input type="reset" value=" 重 写 " name="B2"></p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -