📄 addnew.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<!-- #include virtual="include/String.asp" -->
<%
Dim ObjRS,StrSQL,ObjRSTypeSelect,conn,rs
%>
<%
if session("AccountID")="" then
%>
<script language=javascript>
alert("因登录时间过长,会话失效,请退出重新登陆!")
</script>
<%
Response.End
end if
Set conn=Server.CreateObject("ADODB.Connection")
OpenDBCrm( conn )
%>
<%
If Request.Form.Count > 0 Then
If Trim(Request("_Gindustry"))="" then
Response.Write "<script language=javascript>alert('请填写客户类型');history.back();</script>"
Response.End
End if
StrSQL="select * from T_CRM_Guest_industry Where Gindustry='"&Trim(Request("_Gindustry"))&"'"
Set ObjRS=conn.Execute(StrSQL)
If Not(ObjRS.Eof and ObjRS.Bof) Then
ObjRS.close
Set ObjRS=Nothing
conn.close
Set conn=Nothing
Response.Write "<script language=javascript>alert('已添加过该行业类型,请重新填写');history.back();</script>"
Response.End
End if
Dim C
Dim IntID
Set conn=Server.CreateObject("ADODB.Connection")
OpenDBCrm( conn )
conn.Execute("insert into T_CRM_Guest_industry (Gindustry,Gtype_ID,creater,CreateTime) values ('"&FixSQL(Request("_Gindustry"))&"','"&FixSQL(Request("_Gtype_ID"))&"','"&session("AccountID")&"','"&date()&"')")
conn.Close
Set conn = Nothing
Response.Redirect "List.asp"
End If
Sub Main
%>
<HTML><HEAD>
<form action="" method="post" onsubmit="return(CheckForm(this))">
<input type=hidden name=_AccountID value=<%=Session("AccountID")%>>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr align="middle">
<td width="15%">新增客户类型</td>
<td width="85%"> </td>
</tr>
<tr class=Ltr>
<td>选择客户行业</td>
<td>
<%
Set ObjRSTypeSelect = conn.Execute("select * from T_CRM_Guest_type")
If ObjRSTypeSelect.EOF and ObjRSTypeSelect.Bof Then
response.write "请先添加客户行业"
Response.End
else
%>
<select name="_Gtype_ID">
<option value="<%=ObjRSTypeSelect("ID")%>" selected><%=ObjRSTypeSelect("Gtype")%></option>
<%
ObjRSTypeSelect.movenext
do while not ObjRSTypeSelect.eof
%>
<option value="<%=ObjRSTypeSelect("ID")%>"><%=ObjRSTypeSelect("Gtype")%></option>
<%
ObjRSTypeSelect.movenext
loop
ObjRSTypeSelect.close
%>
</select>
<%End if%>
</td>
</tr>
<tr class=Ltr>
<td>客户类型</td>
<td><input class=Input Check=1 Show="客户类型" name="_Gindustry" type="text"></td>
</tr>
</table>
<table cellspacing=1 cellpadding=3>
<tr>
<td>
<input type="submit" name="Submit" class=Button value="提 交"><input type="button" class=Button value="取 消" onclick="doList()" id=button1 name=button1></td>
<td></td>
</tr>
</table>
</FORM>
<%
End Sub
%>
<!-- #include virtual="Templet/Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -