📄 delete.asp
字号:
rs.Open "select * from quote where quoteid="&request("quoteid"),conn,2,3,1
if not rs.eof then
if rs("status")="初始" then
conn.execute("delete from quote where quoteid="&request("quoteid"))
conn.execute("delete from quoteline where quoteid="&request("quoteid"))
else
response.write "<br><br><br><LINK href='../global.css' rel=stylesheet type=text/css>"
response.Write "<div align=center>"
response.Write "<FONT SIZE=2 class=title>"
response.write "<img src=../images/jg.gif>"
response.write "只能删除初始的报价单"
response.write "</div>"
response.end
end if
end if
elseif request("orderid")<>"" then
objcheck.CheckUserFunction "order","del"
set rsq=conn.Execute("select id from orderreserve where orderlineid in(select lineid as orderlineid from orderline where orderid="&request("orderid")&")")
if not rsq.eof then
response.write "<br><br><br><LINK href='../global.css' rel=stylesheet type=text/css>"
response.Write "<div align=center>"
response.Write "<FONT SIZE=2 class=title>"
response.write "<img src=../images/jg.gif>"
response.write "有保留记录的合同不能删除"
response.write "</div>"
end if
set rsq=conn.Execute("select orderid from v_MaterialTransaction where orderid="&request("orderid"))
if not rsq.eof then
response.write "<br><br><br><LINK href='../global.css' rel=stylesheet type=text/css>"
response.Write "<div align=center>"
response.Write "<FONT SIZE=2 class=title>"
response.write "<img src=../images/jg.gif>"
response.write "有发货记录的合同不能删除"
response.write "</div>"
else
set rsq=conn.Execute("select status from [order] where orderid="&request("orderid"))
if rsq("status")="初始" then
rs.Open "delete from [order] where orderid="&request("orderid"),conn,2,3,1
rs.Open "delete from orderline where orderid="&request("orderid"),conn,2,3,1
else
Response.Write "只有初始合同才可以删除!"
end if
end if
elseif request("poid")<>"" then
objcheck.CheckUserFunction "po","del"
rs.Open "delete from po where poid="&request("poid"),conn,2,3,1
rs.Open "delete from poline where poid="&request("poid"),conn,2,3,1
elseif request("poreceiveid")<>"" then
objcheck.CheckUserFunction "po","del"
rs.Open "delete from poreceive where poreceiveid="&request("poreceiveid"),conn,2,3,1
rs.Open "delete from poreceiveline where poreceiveid="&request("poreceiveid"),conn,2,3,1
elseif request("dealstageid")<>"" then
rs.Open "delete from dealstage where id="&request("dealstageid"),conn,2,3,1
elseif request("dealprocessid")<>"" then
rs.Open "delete from dealprocess where dealprocessid="&request("dealprocessid"),conn,2,3,1
elseif request("poprintlineid")<>"" then
rs.Open "delete from podeliverytemp where lineid="&request("poprintlineid"),conn,2,3,1
elseif request("smartsalesid")<>"" then
rs.Open "delete from smartsales where id="&request("smartsalesid"),conn,2,3,1
elseif request("locationid")<>"" then
rs.Open "delete from location where locationid="&request("locationid"),conn,2,3,1
elseif request("priceid")<>"" then
objcheck.CheckUserFunction "price","del"
rs.Open "delete from price where priceid="&request("priceid"),conn,2,3,1
elseif request("popriceid")<>"" then
objcheck.CheckUserFunction "price","del"
rs.Open "delete from poprice where priceid="&request("popriceid"),conn,2,3,1
elseif request("deliveryid")<>"" then
objcheck.CheckUserFunction "order","del"
rs.Open "delete from delivery where deliveryid="&request("deliveryid"),conn,2,3,1
rs.Open "delete from deliveryline where deliveryid="&request("deliveryid"),conn,2,3,1
elseif request("payid")<>"" then
objcheck.CheckUserFunction "payment","del"
conn.execute("insert into operatelog(username,opdate,operate,data,description)values('"&session("username")&"','"&now()&"','删除','付款记录','"&request("account")&",金额:"&request("amount")&",id:"&request("payid")&"')")
rs.Open "delete from pay where payid="&request("payid"),conn,2,3,1
elseif request("initialfinanceid")<>"" then
rs.Open "delete from initialfinance where id="&request("initialfinanceid"),conn,2,3,1
elseif request("initialwhseid")<>"" then
rs.Open "delete from InitialInventory where id="&request("initialwhseid"),conn,2,3,1
elseif request("poapproveid")<>"" then
rs.Open "delete from poapprove where id="&request("poapproveid"),conn,2,3,1
elseif request("accountshareid")<>"" then
rs.Open "delete from accountshare where id="&request("accountshareid"),conn,2,3,1
elseif request("poapplyid")<>"" then
objcheck.CheckUserFunction "po","del"
set rsq=conn.execute("select poapplyid from poline where poapplyid="&request("poapplyid"))
if not rsq.eof then
response.write "<br><br><br><LINK href='../global.css' rel=stylesheet type=text/css>"
response.Write "<div align=center>"
response.Write "<FONT SIZE=2 class=title>"
response.write "<img src=../images/jg.gif>"
response.write "已经转换为采购单,不能删除!"
response.write "</div>"
response.end
end if
rs.Open "delete from poapply where poapplyid="&request("poapplyid"),conn,2,3,1
end if
set rs=nothing
conn.Close
set conn=nothing
%>
<script language=javascript>
window.opener.location.reload();
window.close();
</script>
<%
end if
%>
<title>删除</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Link href="global.css" rel=stylesheet type=text/css>
<Script Language="javascript" >
function dosub()
{
form1.Mod.value = "Delete" ;
form1.submit();
}
</Script>
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<form method="post" id=form1 name=form1>
<input type=hidden name="Mod" >
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF">
<%if request("warn")<>"" then%>
<tr align=left height=50>
<td><img src="images/jg.gif"><font color=red>警告:</font><font color=blue><%=request("warn")%></font></td>
</tr>
<%end if%>
<%
dim getrecord
if request("dealprocessid")<>"" then getrecord=DeleteComfirm( "dealprocess","dealprocessid",cint(request("dealprocessid")))
%>
<tr height=50>
<td class=title><div align="center">确信要删除吗?</div></td>
</tr>
<tr>
<td align="center">
<a onclick="return dosub()"><img src="images/button_confirm.gif" style="cursor:hand"></a>
<img src="images/button_cancel.gif" style="cursor:hand" border=0 language=javascript onclick="window.close();">
</td>
</tr>
</table>
</form>
</body>
</html>
<%set objcheck=nothing%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -