delete.asp

来自「功能齐全的oa系统」· ASP 代码 · 共 35 行

ASP
35
字号
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
	Dim ObjDB,StrSQL,ObjRS,ObjDepID
	Dim C,IntIDs

	IntIDs=Request.QueryString("IDs")
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDB ObjDB

	Set C = Server.CreateObject ("CMS2003.DBhandle")
	C.Init(ObjDB)
	Set ObjRS = C.View("Select ID From t_OA_SYS_Department Where ParentID In (" & IntIDs & ") And ParentID<>0")
	
	If ObjRS("ID")="" Then
		Set ObjDepID = C.View("Select ID From t_OA_SYS_Department_Account Where DepID In (" & IntIDs & ") And DepID<>0")
		If ObjDepID("ID") = "" Then
				Call C.Delete(IntIDs,"t_OA_SYS_Department")
				ObjDB.Close
				Set ObjDB = Nothing
				Response.Redirect "List.asp?ParentID=" & Request.QueryString("ParentID")
		Else
			ObjDB.Close
			Set ObjDB = Nothing
			Response.Redirect "../../../Error.asp?Err=存在部门人员,不能删除"

		End If
	
	Else
		ObjDB.Close
		Set ObjDB = Nothing
		Response.Redirect "../../../Error.asp?Err=存在下级部门,不能删除"
	End If
%>

⌨️ 快捷键说明

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