add_buyer.asp

来自「适用于网络/信息企业」· ASP 代码 · 共 446 行 · 第 1/2 页

ASP
446
字号
<!--#include file="../INC/Conn.asp"-->
<!--#include file="inc/Check.asp"-->
<!--#include file="inc/public.asp"-->
<!--#include File="Procedure.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>亿博尔-客户关系管理系统</title>
</head>
<link href="Images/Admin.css" rel="stylesheet" type="text/css">
<%
dim Makking
Makking = Trim(Request.QueryString("Makking"))    
'---------------------------------
select case Makking
case "save"

IF Request.Form("Buyer_Name") = "" or Request.Form("Buyer_Address") = "" or Request.Form("City") = "" or Request.Form("Class") = "" Then

	Save_title="·对不起,带*号的为必填项"   
	call Save_err()

End if

		Buyer_ID       = makerndid(30)
		Do While Ranid_Buyer(Buyer_ID)
		Buyer_ID       = makerndid(30)
		Loop

		Buyer_Name			= Request.Form("Buyer_Name")
		Buyer_Address		= Request.Form("Buyer_Address")
		Buyer_Postcode		= Request.Form("Buyer_Postcode")
		Buyer_Trade			= Request.Form("Class")
		City				= Request.Form("City")
		Buyer_Website		= Request.Form("Buyer_Website")
		Buyer_Mail			= Request.Form("Buyer_Mail")
		Legal_Person		= Request.Form("Legal_Person")		
		Enterprise_Type		= Request.Form("Enterprise_Type")
		Buyer_Telephone		= Request.Form("Buyer_Telephone")
		Buyer_Fax			= Request.Form("Buyer_Fax")
		Buyer_Introduce		= Request.Form("Buyer_Introduce")
		Manage_Mode			= Request.Form("Manage_Mode")

		Conn.Execute("Insert Into Buyer_Info (Buyer_ID,Buyer_Name,Buyer_Address,Buyer_Postcode,Buyer_Trade,City,Buyer_Website,Buyer_Mail,Legal_Person,Enterprise_Type,Buyer_Telephone,Buyer_Fax,Buyer_Introduce,Manage_Mode,Buyer_Estate,My_Buyer,DateTime) Values ('"& Buyer_ID &"','"& Buyer_Name &"','"& Buyer_Address &"','"& Buyer_Postcode &"','"& Buyer_Trade &"','"& City &"','"& Buyer_Website &"','"& Buyer_Mail &"','"& Legal_Person &"','"& Enterprise_Type &"','"& Buyer_Telephone &"','"& Buyer_Fax &"','"& Buyer_Introduce &"','"& Manage_Mode &"','正常',0,'"& Now() &"')")
		
		
	Save_BackUrl = "Add_Buyer.asp?Makking=Save_3&Buyer_ID="& Buyer_ID &"&Buyer_Name="& Buyer_Name &""
	Save_title="·添加成功"   
	call Save_ok()

case "Save_4"

My_Buyer_Type			= Request.Form("My_Buyer_Type")

Set Rs = Conn.Execute("Select * From My_Buyer Where Buyer_ID = '"& Request.QueryString("Buyer_ID") &"' and Employee_ID = '"& Session("Eboer_CRM_Employee_ID") &"'")

	IF Rs.bof AND Rs.eof Then

		My_Buyer_ID       = makerndid(30)
		Do While Ranid_My_Buyer(My_Buyer_ID)
		My_Buyer_ID       = makerndid(30)
		Loop
	
		Conn.Execute("Insert Into My_Buyer (Buyer_ID,My_Buyer_ID,Employee_ID,My_Buyer_Type,DateTime) Values ('"& Request.QueryString("Buyer_ID") &"','"& My_Buyer_ID &"','"& Session("Eboer_CRM_Employee_ID") &"','"& My_Buyer_Type &"','"& now() &"')")
		
	Else

		Conn.Execute("upDate My_Buyer Set My_Buyer_Type = '"& My_Buyer_Type &"' Where Buyer_ID = '"& Request.QueryString("Buyer_ID") &"' and Employee_ID = '"& Session("Eboer_CRM_Employee_ID") &"'")

	End IF
	
	Rs.Close
	
Set Rs = Nothing

Set Rs = Conn.Execute("Select Count(*) As My_Buyer_Count From My_Buyer Where Buyer_ID = '"& Request.QueryString("Buyer_ID") &"'")

	My_Buyer_Count = Rs("My_Buyer_Count")
		
	Rs.Close
	
Set Rs = Nothing

	Conn.Execute("upDate Buyer_Info Set My_Buyer = "& My_Buyer_Count &" Where Buyer_ID = '"& Request.QueryString("Buyer_ID") &"'")

	Save_BackUrl = "Add_Buyer.asp"
	Save_title="·添加成功"   
	call Save_ok()

case ""

%>
<body>
<table width="98%" height="40"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D8D8D8">
      <tr>
        <td height="30" align="left" bgcolor="ffffff"><table width="100%" height="100%"  border="0" cellpadding="3" cellspacing="0">
            <tr bgcolor="eeeeee">
              <td width="5%" align="center"><img src="Images/1.gif" width="13" height="12"></td>
                <td width="85%"><span class="style2">管理中心 &gt;&gt;&gt; 添加客户</span></td>
                <td width="10%" align="right">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="98%" height="88%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D8D8D8">
  <tr>
    <td valign="top" bgcolor="ffffff"><table width="95%"  border="0" align="center" cellpadding="5" cellspacing="0">
        <tr>
          <td align="center" valign="top" bgcolor="ffffff"> 
            <form method='POST' name="form" action="Add_Buyer.asp?Makking=Save_1">
			  <br>
              <table width=100% border=0 align='center' cellpadding=3 
      cellspacing=1 bordercolordark=#ffffff bgcolor="#EBEBEB" class='size09'>
                <tr> 
                  <td width="25%" height="22" align="right" bgcolor="ffffff"><font color="#FF0000"><font color="#FF0000">*</font></font> 
                    客户名称:</td>
                  <td height="22" bgcolor="ffffff"> <input name="Buyer_Name" type="text" id="Buyer_Name" value="<%Session("Add_Buyer_Buyer_Name")%>" size="50" maxlength="50"> 
                  </td>
                </tr>
              </table>
              <p> 
                <input name="B1" type="image" src="Images/see.gif" width="36" height="21" border="0">
                &nbsp; <a href="javascript:history.go(-1)"><img src="Images/back.gif" width="36" height="21" border="0"></a> 
              </p>
            </form></td>
        </tr>
      </table>      
      
    </td>
  </tr>
</table>
<%Case "Save_1"

	Session("Add_Buyer_Buyer_Name") = Request.Form("Buyer_Name")
	
		SQL = "Select top 50 * From Buyer_Info Where Buyer_Name like '%"& Request.Form("Buyer_Name") &"%'"
	
		Set Rs = Conn.Execute(SQL)
		
		IF Rs.eof and Rs.bof Then
	
			Response.Redirect("Add_Buyer.asp?Makking=Save_2")
	
		End IF
	
		Rs.Close
		
		Set Rs = Nothing
%>
<table width="98%" height="40"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td><table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D8D8D8">
        <tr> 
          <td height="30" align="left" bgcolor="ffffff"><table width="100%" height="100%"  border="0" cellpadding="3" cellspacing="0">
              <tr bgcolor="eeeeee"> 
                <td width="5%" align="center"><img src="Images/1.gif" width="13" height="12"></td>
                <td width="85%"><span class="style2">管理中心 &gt;&gt;&gt; 添加客户</span></td>
                <td width="10%" align="right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="98%" height="88%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D8D8D8">
  <tr> 
    <td valign="top" bgcolor="ffffff"><table width="95%"  border="0" align="center" cellpadding="5" cellspacing="0">
        <tr> 
          <td align="center" valign="top" bgcolor="ffffff"> <form method='POST' name="form" action="Add_Buyer.asp?Makking=Save_1">
              <br>
              <table width=100% border=0 align='center' cellpadding=3 
      cellspacing=1 bordercolordark=#ffffff bgcolor="#EBEBEB" class='size09'>
                <tr> 
                  <td width="25%" height="22" align="right" bgcolor="ffffff"><font color="#FF0000"><font color="#FF0000">*</font></font> 
                    客户名称:</td>
                  <td height="22" bgcolor="ffffff"> <input name="Buyer_Name" type="text" id="Buyer_Name" value="<%=Session("Add_Buyer_Buyer_Name")%>" size="50" maxlength="50"> 
                  </td>
                </tr>
              </table>
              <p> 
                <input name="B12" type="image" src="Images/see.gif" width="36" height="21" border="0">
                &nbsp;<a href="Add_Buyer.asp?Makking=Save_2"><img src="Images/add.gif" width="36" height="21" border="0"></a> 
                &nbsp;<a href="javascript:history.go(-1)"><img src="Images/back.gif" width="36" height="21" border="0"></a> 
              </p>
            </form></td>
        </tr>
      </table>
      <table width=95% border=0 align='center' cellpadding=3 cellspacing=1 bordercolordark=#ffffff bgcolor="eaeaea">
    <%
	Set rs=server.CreateObject("adodb.recordset")
	rs.open SQL,Conn,1,1
	IF not (rs.BOF and rs.eof) then
%>
        <tr> 
          <td>已有<font color="#FF0000"><%=rs.RecordCount%></font>家名称相同或相近的客户存在于数据库</td>
          <td>联系人</td>
          <td>联系记录</td>
          <td>联系任务</td>
          <td>业务管理</td>
          <td>我的客户</td>
        </tr>
        <%
	while Not Rs.eof
%>
        <tr align="left" bgcolor="ffffff" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F5F5F5'"> 
          <td height="22">
		  <a href="javascript:Buyer_Edit('<%=Rs("Buyer_ID")%>');"><%=Rs("Buyer_Name")%></a>
		  </td>
          <td width="12%" height="22"><a href="javascript:LinkMan_List('<%=Rs("Buyer_ID")%>');">查看</A>|<a href="javascript:LinkMan_Add('<%=Rs("Buyer_ID")%>');">添加</A></td>
          <td width="12%" height="22"><a href="javascript:Link_Log_List('<%=Rs("Buyer_ID")%>');">查看</A>|<a href="javascript:Link_Log_Add('<%=Rs("Buyer_ID")%>');">添加</A></td>
          <td width="12%" height="22"><a href="javascript:Link_Task_List('<%=Rs("Buyer_ID")%>');">查看</A>|<a href="javascript:Link_Task_Add('<%=Rs("Buyer_ID")%>');">添加</A></td>
          <td width="12%" height="22"><a href="javascript:Operation_List('<%=Rs("Buyer_ID")%>');">记录</A>|<a href="javascript:Operation_Add('<%=Rs("Buyer_ID")%>');">添加</A></td>
          <td width="12%" height="22"><a href="javascript:My_Buyer_Add('<%=Rs("Buyer_ID")%>');">添加到</a>[<%=Rs("My_Buyer")%>]</td>
        </tr>
        <%
	rs.movenext
	wend
	end if
rs.close

⌨️ 快捷键说明

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