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

📄 dengji.asp

📁 asp_erp 源碼 附詳盡使用說明及數據庫
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp"-->
<html>
<head>
<title>∷企业生产管理信息系统:.</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="js/selectcity.js"></script>
<script language="JavaScript" src="js/validate.js" type="text/JavaScript"></script>

<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 Juge(myform)
{

	if (myform.dengjinumber.value == "")
	{
		alert("编号不能为空!");
		myform.dengjinumber.focus();
		return (false);
	}
	if (myform.dengjiname.value == "")
	{
		alert("名称不能为空!");
		myform.dengjiname.focus();
		return (false);
	}
	if (myform.price.value == "")
	{
		alert("单价不能为空,若无,可设置默认为1!");
		myform.price.focus();
		return (false);
	}
}


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 dengji"
rs.open sql,conn,1,3
rs.addnew
rs("dengjinumber") = trim(request.Form("dengjinumber"))
rs("dengjiname") = trim(request.Form("dengjiname"))
rs("danwei") = trim(request.Form("danwei"))
rs("price") = request.Form("price")
rs("content") = trim(request.Form("content"))
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('添加成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=dengji.asp"">"
response.end
rs.close
set rs=nothing
end sub

 
sub SaveModify   
set rs=server.createobject("adodb.recordset") 
sql="select * from dengji where id="&request.Form("id")
rs.open sql,conn,1,3
rs("dengjiname") = trim(request.Form("dengjiname"))
rs("dengjinumber") = trim(request.Form("dengjinumber"))
rs("danwei") = trim(request.Form("danwei"))
rs("price") = request.Form("price")
rs("content") = trim(request.Form("content"))
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('修改成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=dengji.asp"">"
response.end
rs.close
set rs=nothing
end sub   
 
  sub delCate()
        conn.execute("delete from dengji where id in ("&Request.Form("selBigClass")&")")
		response.Write "<script language=javascript>alert('删除成功!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=dengji.asp"">"
response.end
  end sub
  %> <% sub myform(isEdit) %> 	  
<TABLE width=800 align=center border="1" cellspacing="0" cellpadding="0" bordercolor="#0055E6">
  <TBODY> 
  <TR> 
    <td align="center" valign="top"> <%if oskey="supper" then%>
	
	<%
	    set rs=server.createobject("adodb.recordset")
	   if isedit then
		   rs.open "select * from dengji where id=" & request("id"),conn,1,1
%>

    <table width="800" border="0" cellpadding="0" cellspacing="0" >
          <tr >  
<td height=26 background="images/background.gif">
<b><font color="#ffffff">编辑供货单位信息</font></b>

</td>
</tr>
</table>
<%
else
%>
    <table width="800" border="0" cellpadding="0" cellspacing="0" >
          <tr >  
<td height=26 background="images/background.gif">
<b><font color="#ffffff">添加供货单位信息</font></b>

</td>
</tr>
</table>
<%end if %>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
          <tr class="but"> 
			<td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but'">等级编号</td>
            <td width="30%" height="18" align="center" class="but" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.className='but'" onMouseOut="this.dengjiName='but'">等级名称</td>
			<td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but'">单 位</td>
            <td width="30%" height="18" align="center" class="but" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.className='but'" onMouseOut="this.dengjiName='but'">单 价</td>
			<td width="50%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but'" colspan="2">备注</td>
			
          </tr>
		  <form name="reg" method="post" action="dengji.asp" onSubmit="return Juge(this)" >
		  <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 height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input name="dengjinumber" type="text"  size="10"  value='<% if isedit then
		                                                         response.write rs("dengjinumber")
																  end if %>'></td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input name="dengjiname" type="text"  size="25" value='<% if isedit then
		                                                         response.write rs("dengjiname")
																  end if %>'></td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'">
			<select name="danwei" 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("danwei")=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 height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input name="price" type="text"  size="10" value='<% if isedit then
		                                                         response.write rs("price")
																  end if %>'></td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input name="content" type="text"  size="30" value='<% if isedit then
		                                                         response.write rs("content")
																  end if %>'></td>
<td height="18" align="center" class="but11" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but11'"><input type="submit" class="button" value="<% if isedit then
		                                                         response.write "编辑"
																 else
																 response.write "添加"
																  end if %>"> </td>
          </tr>
		  </form>
		  
           </table>
        <%end if%></td>
</tr>
</table>
<br><br>
<TABLE width=820 align=center border="0" cellspacing="20" cellpadding="2" bordercolor="#0055E6">
<tr>
<td >

			<form action="dengji.asp" method="post" name="selform" >
  <table width="800"  border="1" cellpadding="0" cellspacing="0" bordercolor="#0055E6" align="center">

    <tr> 
      
      <td width="800" align="center" valign="top">
	        <table width="800" border="0" cellpadding="0" cellspacing="0" >
          <tr >  
<td height=26 background="images/background.gif">
<b><font color="#ffffff">产 品 信 息 列 表</font></b>

</td>
</tr>
</table>
	 
        <table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#EFEADD">
          <tr class="but"> 
			<td width="15%" height="18" align="center" class="but01" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but01'">等级编号</td>
            <td width="15%" height="18" align="center" class="but01" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but01'">等级名称</td>
			<td width="10%" height="18" align="center" class="but01" onMouseDown="this.className='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but01'">单 位</td>
            <td width="10%" height="18" align="center" class="but01" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.className='but'" onMouseOut="this.dengjiName='but01'">单 价</td>
			<td width="20%" height="18" align="center" class="but01" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but01'">备 注</td>
            <td width="5%" height="18" align="center" class="but01" onMouseDown="this.dengjiName='tddown'" onMouseUp="this.dengjiName='but'" onMouseOut="this.dengjiName='but01'">操 作</td>
          </tr>
		 <%
set rs=server.CreateObject("ADODB.RecordSet") 
rs.Source="select* from dengji"
rs.Open rs.Source,conn,1,1
if not rs.EOF then
do while not rs.eof
%>
<tr onmouseover="this.bgColor='#73A475';" onmouseout="this.bgColor=''"">
<td height="18" align="center"><a href="dengji.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("dengjinumber")%></a></td>
<td height="18" align="center"><%=rs("dengjiname")%><%if rs("dengjiname")="" then%>&nbsp;<%end if%></td>
<td height="18" align="center"><%=rs("danwei")%><%if rs("danwei")="" then%>&nbsp;<%end if%></td>
<td height="18" align="center"><%=FormatCurrency(rs("price"),2,,,0)%><%if rs("price")="" then%>&nbsp;<%end if%></td>
<td height="18" align="center"><%=rs("content")%><%if rs("content")="" then%>&nbsp;<%end if%></td>
<td height="18" align="center"><input name="selBigClass" type="checkbox" id="selBigClass" value="<%=rs("ID")%>"></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<tr><td align="right" colspan="10" height="22"> <%if oskey="supper" then%>
        <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()"> 选择/反选
              <input onClick="{if(confirm('此操作将删除该信息!\n\n确定要执行此项操作吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action2> 
              <input type="Hidden" name="action" value='del'><%end if%></td></tr>
        </table>

	  
</td>
    </tr>

  </table></fieldset>
</form>
			</TD>
              </TR>
          </table>
		          

  </TBODY>
</TABLE>
<%end sub%>
<P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  <TBODY>
  <TR vAlign=center>
    <TD align=middle width="100%"><!--#include file="footer.htm"--></TD>
  </TR></TBODY></TABLE></P></BODY></HTML>


⌨️ 快捷键说明

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