⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 material.asp

📁 汽车4s店库存管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp"-->
<html>
<head>
<title>∷汽车4S店配件仓储管理系统:.</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript src="css/init.js"></SCRIPT>

<style type="text/css">
<!--
td {  font-family: "宋体"; font-size: 9pt}
body {  font-family: "宋体"; font-size: 9pt}
select {  font-family: "宋体"; font-size: 9pt}
A {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
A:hover {text-decoration: underline; color: #FF0000; font-family: "宋体"; font-size: 9pt} 
-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--

function SelectAll() {
	for (var i=0;i<document.selform.selBigClass.length;i++) {
		var e=document.selform.selBigClass[i];
		e.checked=!e.checked;
	}
}
//-->
</script>
</HEAD>
<BODY topMargin=0 rightMargin=0 leftMargin=0>       
<!--#include file="top.asp"--><% dim sql,rs

  select case request("action")
  case "add"
       call SaveAdd()
  case "modify"
       call SaveModify()
  case "del"
       call delCate()
  case "edit"
       isEdit=True
       call myform(isEdit)
  case else
       isEdit=False
       call myform(isEdit) 
  end select

  
  sub SaveAdd   
set rs=server.createobject("adodb.recordset") 
sql="select * from Material where class='"&trim(request.Form("class"))&"' and pinming='"&trim(request.Form("pinming"))&"' and guige='"&trim(request.Form("guige"))&"'"
rs.open sql,conn,1,3
if not rs.eof then
response.Write "<script language=javascript>alert('对不起,你现在添加的材料名称已经存在!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=Material.asp"">"
response.end
else
rs.addnew
rs("class") = trim(request.Form("class"))
rs("code") = trim(request.Form("code"))
rs("pinming") = trim(request.Form("pinming"))
rs("guige") = trim(request.Form("guige"))
rs("Unit") = trim(request.Form("Unit"))
rs("price") = request.Form("price")
rs("baojing_num") = request.Form("baojing_num")
rs.update
response.Write "<script language=javascript>alert('添加成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=Material.asp"">"
response.end
end if
rs.close
set rs=nothing
end sub

 
sub SaveModify   
set rs=server.createobject("adodb.recordset") 
sql="select * from Material where id="&request.Form("id")
rs.open sql,conn,1,3
rs("class") = trim(request.Form("class"))
rs("code") = trim(request.Form("code"))
rs("pinming") = trim(request.Form("pinming"))
rs("guige") = trim(request.Form("guige"))
rs("Unit") = trim(request.Form("Unit"))
rs("price") = trim(request.Form("price"))
rs("baojing_num") = request.Form("baojing_num")
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=Material.asp"">"
response.end
end sub   
 
  sub delCate()
        conn.execute("delete from Material where id in ("&Request.Form("selBigClass")&")")
		response.Write "<script language=javascript>alert('删除成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=Material.asp"">"
response.end
  end sub
  %> <% sub myform(isEdit) %> 	  
<TABLE width=98% align=center border="1" cellspacing="0" bordercolor="#D6D3CE">
  <TBODY> 
  <TR> 
    <td align="center" valign="top"><%if oskey="supper" or oskey="admin" then%> 
	<fieldset style="width:98%"><legend>
	<%
	    set rs=server.createobject("adodb.recordset")
	   if isedit then
		   rs.open "select * from Material where id=" & request("id"),conn,1,1
	       response.write "编辑材料信息"
	   else
	       response.write "添加材料信息"
	   end if %></legend>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
          <tr class="but"> 
			<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">编 号</td>
			<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类  别</td>
            <td width="30%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">配件名称</td>
			<td width="30%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">车 型</td>
			<td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">计量单位</td>
			<td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">采购单价</td>
			<td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">报警数量</td>
          </tr>
		  <form name="reg" method="post" action="Material.asp">
		  <tr> <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else %>add<% End If %>'> 
		  <% If isedit then%><input type="Hidden" name="id" value="<%=rs("id")%>"> <% End If %>
            <td align="center"><input name="code" type="text"  size="25" value='<% if isedit then
		                                                         response.write rs("code")
																  end if %>'></td>
			<td height="18" align="center">
			<select name="class" size="1">
			<%
	       set rs2=server.createobject("adodb.recordset")
		   rs2.open "select * from class",conn,1,1
		   if not rs2.eof then
		   do while not rs2.eof
		   classnumber=rs2("classnumber")
		   %>
		   <option value="<%=rs2("classnumber")%>" <% if isedit then
		   if classnumber=rs("class") then%> selected="selected"<%end if %><%end if %>><%=rs2("classnumber")%></option>
		   
			<%
			rs2.movenext
			loop
			end if
			rs2.close
			set rs2=nothing
			%></select></td>
            <td align="center"><input name="pinming" type="text"  size="25" value='<% if isedit then
		                                                         response.write rs("pinming")
																  end if %>'></td>
            <td align="center"><input name="guige" type="text"  size="25" value='<% if isedit then
		                                                         response.write rs("guige")
																  end if %>'></td>
			<td align="center">
			<select name="Unit" size="1">
			<%
set rs0=server.CreateObject("ADODB.RecordSet") 
rs0.Source="select* from Unit"
rs0.Open rs0.Source,conn,1,1
if not rs0.EOF then
do while not rs0.eof
%>
			
			<option <% if isedit then
			if rs("Unit")=rs0("Unit") then
			%> selected="selected"<%end if%><%end if%>><%=rs0("Unit")%></option>
			<%
			rs0.movenext
			loop
			end  if
			rs0.close
			set rs0=nothing
			%>
			
			</select>
			</td>
			<td align="center"><input name="price" type="text"  size="10" value='<% if isedit then
		                                                         response.write rs("price")
																  end if %>'></td>
         <td align="center"><input name="baojing_num" type="text"  size="10" value='<% if isedit then
		                                                         response.write rs("baojing_num")
																  end if %>'></td>
		  </tr>
		  <tr> 
            
			<td align="center" colspan="8" height="25"><input type="submit"  value="<% if isedit then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -