?? bookingdel.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="inc/adovbs.asp"-->
<!--#include file="Inc/Conn.asp"-->
<!--#include file="Inc/Check.asp"-->
<!--#include file="inc/SQLCHK.asp"-->
<%
Function OutputMsg(StrOut)
Response.write "<script language='javascript'>" &Chr(13)
Response.write "alert('"&StrOut&"');" &Chr(13)
Response.write "</script>" &Chr(13)
End Function
Function GoBack()
Response.write "<script language='javascript'>" &Chr(13)
Response.write "javascript:history.go(-1);"&Chr(13)
Response.write "</script>" &Chr(13)
Response.end
End Function
Function Successed()
Response.write "<script language='javascript'>" &Chr(13)
Response.write "alert('刪除成功!');" &Chr(13)
Response.write "location = 'RegQuery.asp'"&Chr(13)
Response.write "</script>" &Chr(13)
Response.end
End Function
If Request.QueryString("Action") = "Del" Then
If Request.QueryString("RegID")="" Then
OutputMsg("參數(shù)有問題!")
GoBack()
Else
'創(chuàng)建命令對象
Dim RegCmd, SQLStr, RS
Set RegCmd = Server.CreateObject("ADODB.Command")
RegCmd.ActiveConnection = Conn
'檢查預約情況!
SQLStr = "Select DiagDate From [Registration] Where ID="&Request.QueryString("RegID")
RegCmd.CommandText = SQLStr
Set RS = RegCmd.Execute
'如果預約不存在!
If RS.EOF And RS.BOF Then
OutputMsg("預約ID錯誤!")
GoBack1()
Else
'如果就診日期是今天或今天以前!
If RS("DiagDate") <= Date() Then
OutputMsg("刪除失敗!")
GoBack()
Else
SQLStr = "Delete * From [Registration] Where ID="&Request.QueryString("RegID")
RegCmd.CommandText = SQLStr
RegCmd.Execute
Successed()
End If
End IF
RegCmd.ActiveConnection.Close
RS.Close
Set RS=Nothing
Conn.Close
Set Conn=Nothing
End If
Else
Response.write "<script language='javascript'>" &Chr(13)
Response.write "alert('參數(shù)有問題!');" &Chr(13)
Response.write "location = 'Expert.asp'"&Chr(13)
Response.write "</script>" &Chr(13)
Response.end
End IF
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -