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

📄 addsale.asp

📁 漂亮的模板,商店销售统计,日销售,月销售统计,销售录入
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!-- pingmac www.pingmac.com -->
<!--#include file="../dbconnect/conn.asp" -->
<!--#include file="../inc/SysLoginCheck.inc.asp" -->
  <%
set rsa=Server.CreateObject("adodb.recordset")
sqla="select * from system"
rsa.open sqla,conn,1,1
%>
  <%
set rsb=server.createobject("adodb.recordset")
sqlb="select username from Account WHERE jobnum='"&Session("Jobnum")&"'"
rsb.open sqlb,conn,1,1
mman=rsb("username")
rsb.close
  set rsb=nothing
%>
<%
leixing=trim(request("leixing"))
huilv=trim(request("huilv"))
xsman=trim(request("xsman"))
ticheng=request("ticheng")
khlx=trim(request("khlx"))
fflx=trim(request("fflx"))
sub getSalestypesBoardTree() 
	set rsh=server.CreateObject("adodb.recordset")
	sqlh="Select Salestypes from Salestypes"
	rsh.Open sqlh,conn,1,3
	do while not rsh.EOF
	tempcataStr="<option value="&trim(rsh("Salestypes"))&""
	if trim(rsh("Salestypes")) = leixing then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsh("Salestypes"))&"</option>"
		Response.Write tempcataStr
		
		  		rsh.MoveNext
		loop 
		  	rsh.Close()
  	set rsh=nothing
end sub
sub getCurrencyBoardTree() 
	set rsl=server.CreateObject("adodb.recordset")
	sqll="Select Currencyname,huilv from Currency"
	rsl.Open sqll,conn,1,3
	do while not rsl.EOF
	    tempcataStr="<option value="&trim(rsl("huilv"))&""
	if trim(rsl("huilv")) = huilv then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsl("Currencyname"))&"</option>"
		Response.Write tempcataStr
		
		  		rsl.MoveNext
		loop 
		  	rsl.Close()
  	set rsl=nothing
end sub
sub getGenerateratioBoardTree() 
	set rsg=server.CreateObject("adodb.recordset")
	sqlg="Select Generateratio from Generateratio"
	rsg.Open sqlg,conn,1,3
	do while not rsg.EOF
	tempcataStr="<option value="&trim(rsg("Generateratio"))&""
	if trim(rsg("Generateratio")) = ticheng then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsg("Generateratio"))&"</option>"
		Response.Write tempcataStr
		
		  		rsg.MoveNext
		loop 
		  	rsg.Close()
  	set rsg=nothing
end sub
sub getsaleBoardTree() 
	set rsf=server.CreateObject("adodb.recordset")
	sqlf="Select username from Account order by id"
	rsf.Open sqlf,conn,1,3
	do while not rsf.EOF
	tempcataStr="<option value="&trim(rsf("username"))&""
	if trim(rsf("username")) = xsman then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsf("username"))&"</option>"
		Response.Write tempcataStr
		
		  		rsf.MoveNext
		loop 
		  	rsf.Close()
  	set rsf=nothing
end sub
sub getCustomertypesBoardTree() 
	set rsi=server.CreateObject("adodb.recordset")
	sqli="Select Customertypes from Customertypes"
	rsi.Open sqli,conn,1,3
	do while not rsi.EOF
	tempcataStr="<option value="&trim(rsi("Customertypes"))&""
	if trim(rsi("Customertypes")) = khlx then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsi("Customertypes"))&"</option>"
		Response.Write tempcataStr
		
		  		rsi.MoveNext
		loop 
		  	rsi.Close()
  	set rsi=nothing
end sub
sub getPaymentBoardTree() 
	set rsj=server.CreateObject("adodb.recordset")
	sqlj="Select Payment from Payment"
	rsj.Open sqlj,conn,1,3
	do while not rsj.EOF
	tempcataStr="<option value="&trim(rsj("Payment"))&""
	if trim(rsj("Payment")) = fflx then tempcataStr = tempcataStr&" selected"
			
		tempcataStr = tempcataStr&">"
		tempcataStr = tempcataStr&""&trim(rsj("Payment"))&"</option>"
		Response.Write tempcataStr
		
		  		rsj.MoveNext
		loop 
		  	rsj.Close()
  	set rsj=nothing
end sub
%>
<%
	dim rs,sql
	set rs=Server.CreateObject("adodb.recordset")
	action = "addnew"
	saleid = Trim(Request.QueryString("saleid"))
	if isNumeric(saleid)=false or saleid="" then
		saleid=0
		action = "addnew"
	end if

set rsp=Server.CreateObject("adodb.recordset")
sqlp = "select * FROM SalesData where id="&saleid
rsp.Open sqlp,conn,1,3
	if rsp.RecordCount=1 then
		action = "modify"   
		mSalestypes=rsp("Salestypes")
		mPrice=rsp("Price")
		mCurrency=rsp("Currency")
		mVolume=rsp("Volume")
		mSalesman=rsp("Salesman")
		mDesignation=rsp("Designation")
		mRemarks=rsp("Remarks")
		mCustomers=rsp("Customers")
		mCustomertypes=rsp("Customertypes")
		mCustomerunits=rsp("Customerunits")
		mPayment=rsp("Payment")
		mGenerateratio=rsp("Generateratio")
		msaleOwed=rsp("saleOwed")
		mExpenditure=rsp("Expenditure")
		msaleTotal=rsp("saleTotal")
		mRevenue=rsp("Revenue")
		mCustomerTelephone=rsp("CustomerTelephone")
		mOweddeadline=rsp("Oweddeadline")
		msaleyear=rsp("saleyear")
		msalemonth=rsp("salemonth")
		msaleday=rsp("saleday")
		msaletime=rsp("saletime")
	else
		action = "addnew"
		saleid = 0
	end if
rsp.Close
set rsp=nothing

sub produceForm()
    mmid = Trim(Request.Form("saleid"))
	mSalestypes = trim(request.form("Salestypes"))
	mPrice = trim(request.form("Price"))
	mCurrency = trim(request.form("Currency"))
	mVolume = trim(request.form("Volume"))
	mSalesman = trim(request.form("Salesman"))
	mDesignation = trim(request.form("Designation"))
	mRemarks = trim(Request.form("Remarks")) 
	mCustomers = trim(request.form("Customers"))
	mCustomertypes = trim(request.form("Customertypes"))
	mCustomerunits = trim(request.form("Customerunits"))
	mPayment = trim(request.form("Payment"))
	mGenerateratio = trim(request.form("Generateratio"))
	msaleTotal = trim(request.form("saleTotal"))
	msaleOwed = trim(request.form("saleOwed"))
	mExpenditure = trim(request.form("Expenditure"))
	mRevenue = trim(request.form("Revenue"))
	mCustomerTelephone = trim(request.form("CustomerTelephone"))
	mOweddeadline = trim(request.form("Oweddeadline"))
		   
	sqlq = "select * from SalesData where id="&Trim(Request.Form("saleid"))
	set rsq = Server.CreateObject("adodb.recordset")
	rsq.Open sqlq,conn,1,3
        if Trim(Request.Form("action"))="modify" then
			if rsq.RecordCount = 1 then
			'修改
				rsq("Salestypes") = mSalestypes
				rsq("Price") = mPrice
				rsq("Currency") = mCurrency
				rsq("Volume") = mVolume
				rsq("Salesman") = mSalesman
				rsq("Designation") = mDesignation
				rsq("Remarks") = mRemarks
				rsq("Customers") = mCustomers
				rsq("Customertypes") = mCustomertypes
				rsq("Customerunits") = mCustomerunits
				rsq("Payment") = mPayment
				rsq("Generateratio") = mGenerateratio
				rsq("zzman") = mman
				rsq("saleTotal") = msaleTotal
				rsq("saleOwed") = msaleOwed
				rsq("Expenditure") = mExpenditure
				rsq("Revenue") = mRevenue
				rsq("CustomerTelephone") = mCustomerTelephone
				rsq("Oweddeadline") = mOweddeadline
				rsq("edittime") = now()
				rsq.Update
				end if  
			 Response.Write("<Script Language='Javascript'>")
			 Response.Write("alert('帐目数据已经修改成功!');")
			 Response.Write("</Script>")
             Response.Write "<script language=javascript>"&_
                            "history.go(-1);"&_
                            "</script>"  
					                           
		else
            rsq.AddNew
				rsq("Salestypes") = mSalestypes
				rsq("Price") = mPrice
				rsq("Currency") = mCurrency
				rsq("Volume") = mVolume
				rsq("Salesman") = mSalesman
				rsq("Designation") = mDesignation
				rsq("Remarks") = mRemarks
				rsq("Customers") = mCustomers
				rsq("Customertypes") = mCustomertypes
				rsq("Customerunits") = mCustomerunits
				rsq("Payment") = mPayment
				rsq("Generateratio") = mGenerateratio
				rsq("zzman") = mman
				rsq("saleTotal") = msaleTotal
				rsq("saleOwed") = msaleOwed
				rsq("Expenditure") = mExpenditure
				rsq("Revenue") = mRevenue

⌨️ 快捷键说明

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