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

📄 convert.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%if  Request("Mod") = "convert" then
'取参数
dim connpara
set connpara=server.CreateObject("adodb.connection")
connpara.Open connstring
set rspara=connpara.Execute("select * from parameter where type='quote'")

	dim conn
	dim rs
	set conn=server.CreateObject("adodb.connection")
	set rs=server.CreateObject("adodb.recordset")
	conn.Open connstring
	
	rs.Open "select top 1 * from quote order by quoteid desc",conn,2,3,1
		x=1
		for l=1 to rspara("len")
			x=x*10
		next
		if not rs.EOF then
			x=x+rs("quoteid")+1
		else
			x=x+1
		end if
	'生成报价	
	set rsdeal=conn.Execute("select * from deal where dealid="&request("id"))
	set rsquote=conn.Execute("insert into quote(creator,createdate,status,quoteno,lastmoddate,accountid,Contactid,Term,ShipVia,CurrencyCode,quotedate,expiredate,Owner,TotalAmount,description,Fromdealid)values('"&session("loginid")&"','"&now()&"','初始','"&rspara("prefix")&right(x,len(x)-1)&"','"&now()&"',"&rsdeal("accountid")&","&rsdeal("contactid")&","&rsdeal("term")&","&rsdeal("shipvia")&","&rsdeal("currencycode")&",'"&date()&"','"&date()+10&"','"&rsdeal("owner")&"',"&rsdeal("totalamount")&",'"&rsdeal("description")&"',"&rsdeal("dealid")&")")
	'生成报价细目
	set rsdealline=conn.Execute("select * from dealline where dealid="&request("id"))
	do while not rsdealline.eof
		setrsquoteline=conn.Execute("insert into quoteline(quoteid,productid,qty,price,discountprice,discount,amount)values('"&rs("quoteid")+1&"',"&rsdealline("productid")&","&rsdealline("qty")&","&rsdealline("price")&","&rsdealline("discountprice")&","&rsdealline("discount")&","&rsdealline("amount")&")")
		rsdealline.movenext
	loop
	'更新销售机会状态
	set rsdealupdate=conn.Execute("update deal set status='生成报价' where dealid="&request("id"))
	set rs=nothing
	conn.Close 
	set conn=nothing
		%>
<script language=javascript>
	alert("成功生成报价:<%=rspara("prefix")&right(x,len(x)-1)%>")
	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 = "convert" ;
		form1.submit();
}    
</Script>
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<div align="center">
<br> <form method="post"  id=form1 name=form1>

<%

%>
  <input type=hidden name="Mod" >
    <br>
    <p>
    <table>
      <%if request("warn")<>"" then%>
      <tr align=left height=50> 
        <td><font color=red>提醒:</font><br> <font color=blue><%=request("warn")%></font> 
        </td>
      </tr>
      <%end if%>
      <tr align=center height=50> 
        <td class=title>确信要生成报价吗? </td>
      </tr>
      <tr align=center> 
        <td style="cursor:hand"> <a onclick="return dosub()"><img src="../images/button_confirm.gif"></a>&nbsp;
          <a onclick="window.close()"><img src="../images/button_cancel.gif" ></a> 
        </td>
      </tr>
    </table>  
  </form>
</div>
</body>
</html>

⌨️ 快捷键说明

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