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

📄 new_exe.asp

📁 === ==ASP销售管理系统
💻 ASP
字号:
<!--#include file="../config.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 1000200	'本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID)	then	'验证权限
	Server.Transfer "../err/un_authorized.htm"
	response.end
end if
%>
<!--**************身份验证部分****************-->
<%
'客户基本信息
Customer_Name = request("Customer_Name")
State = request("State")
City = request("City")
Address = request("Address")
Zip_Code = request("Zip_Code")
Tel = request("Tel")
Fax = request("Fax")
Email = request("Email")
Homepage = request("Homepage")
Trade_Code = request("Trade_Code")
Description = request("Description")
if not IsNot(Customer_Name,"s") then
	response.write "客户名称填写不正确"
	response.end
end if
if not IsNot(Trade_Code,"n") then
	response.write "请选择客户所在的行业"
	response.end
end if
'规范化字符串
Customer_Name = FormatString(Customer_Name)
Address = FormatString(Address)
Description = FormatString(Description)

'需求信息
Demand_Demand_Item = request("Demand_Demand_Item")
Demand_Demand_Account = request("Demand_Demand_Account")
Demand_Description = request("Demand_Description")
if IsNot(Demand_Demand_Item,"s") then
	if not IsNot(Demand_Demand_Account,"n") then
		response.write "金额“" & Demand_Demand_Account & "”输入不正确"
		response.end
	end if
	Demand_Add = "yes"
end if

'联系人
Contact_Person_Contact_Person_Name = request("Contact_Person_Contact_Person_Name")
Contact_Person_Gender = request("Contact_Person_Gender")
Contact_Person_Rank = request("Contact_Person_Rank")
Contact_Person_Tel = request("Contact_Person_Tel")
Contact_Person_Fax = request("Contact_Person_Fax")
Contact_Person_Mobile = request("Contact_Person_Mobile")
Contact_Person_Email = request("Contact_Person_Email")
if IsNot(Contact_Person_Contact_Person_Name,"s") then
	if not IsNot(Contact_Person_Contact_Person_Name,"s") then
		response.write "联系人姓名填写不正确"
		response.end
	end if
	if not IsNot(Contact_Person_Gender,"n") then
		response.write "联系人性别填写不正确"
		response.end
	end if
	Contact_Person_Add = "yes"
end if

'添加客户
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
sql = "select Customer_ID from Customers where Customer_Name = '" & Customer_Name & "'"
set rs = conn.execute(sql)
if not rs.eof then
	response.write "该客户已经存在,如果是曾经删除的客户,请联系管理员恢复删除。"
	response.end
end if
sql = "insert into Customers(Customer_Name,State,City,Address,Zip_Code,Tel,Fax,Email,Homepage,Trade_Code,Description,Employee_ID,Last_Updated_Employee_ID) values('" & Customer_Name & "','" & State & "','" & City & "','" & Address & "','" & Zip_Code & "','" & Tel & "','" & Fax & "','" & Email & "','" & Homepage & "'," & Trade_Code & ",'" & Description & "'," & Session("Employee_ID") & "," & Session("Employee_ID") & ")"
'response.write sql
conn.execute(sql)
rs.close
set rs = nothing
conn.close
set conn = nothing

'操作日志
Rec_Content = "添加客户"
Command_Line = sql
call Op_Rec(Rec_Content,Command_Line)
'===============================================
'取得客户编号
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.open connstr
sql = "select Customer_ID from Customers where Customer_Name = '" & Customer_Name & "'"
set rs = conn.execute(sql)
Customer_ID = rs("Customer_ID")
rs.close
set rs = nothing
conn.close
set conn = nothing
'===============================================
if Demand_Add = "yes" then
	'添加客户需求
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.open connstr
	sql = "insert into Customers_Demand(Demand_Item,Demand_Account,Description,Customer_ID,Employee_ID) values('" & Demand_Demand_Item & "'," & Demand_Demand_Account & ",'" & Demand_Description & "'," & Customer_ID & "," & Session("Employee_ID") & ")"
	'response.write sql
	conn.execute(sql)
	conn.close
	set conn = nothing
	
	'操作日志
	Rec_Content = "添加客户需求记录"
	Command_Line = sql
	call Op_Rec(Rec_Content,Command_Line)
end if
'===============================================
if Contact_Person_Add = "yes" then
	'增加客户联系人
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.open connstr
	sql = "insert into Customers_Contact_Person(Contact_Person_Name,Gender,Rank,Tel,Fax,Mobile,Email,Customer_ID,Employee_ID) values('" & Contact_Person_Contact_Person_Name & "'," & Contact_Person_Gender & ",'" & Contact_Person_Rank & "','" & Contact_Person_Tel & "','" & Contact_Person_Fax & "','" & Contact_Person_Mobile & "','" & Contact_Person_Email & "'," & Customer_ID & "," & Session("Employee_ID") & ")"
	'response.write sql
	conn.execute(sql)
	conn.close
	set conn = nothing
	
	'操作日志
	Rec_Content = "添加客户联系人"
	Command_Line = sql
	call Op_Rec(Rec_Content,Command_Line)
end if
%>
成功添加客户!
<script language="JavaScript" type="text/javascript">
	parent.main.location.reload();
</script>

⌨️ 快捷键说明

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