📄 delete.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim ObjDB,StrSQL,ObjRS,ObjDepID,ObjRSH,ObjRSP,PSQL
Dim C,IntIDs
If Request.Form.Count > 0 Then
if request("OpeDesc")<>"" then
IntIDs=Request.QueryString("IDs")
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB
PSQL = "Select Count(*) From T_Hrms_Dep_Account Where DepID In (" & IntIDs & ")"
StrSQL = "Select Count(*) From T_Hrms_Dep Where ParentID In (" & IntIDs & ")"
Set ObjRSH = ObjDB.Execute(StrSQL)
Set ObjRSP = ObjDB.Execute(PSQL )
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
Set ObjRS = C.View("Select ID From T_Hrms_Dep Where ParentID In (" & IntIDs & ") And ParentID<>0")
if ObjRSH(0) = 0 then
if ObjRSP(0) = 0 then
Call C.Delete(IntIDs,"T_Hrms_Dep")
'添加日志
dim FirstMenu,SecondMenu,Opertion,OTime,OName,OIP,ODesc,OChang
OIP=Request.ServerVariables("REMOTE_ADDR")
OName= Session("AccountName")
if OName="administrator" then
OName="系统管理员"
end if
call AddLog("部门管理","部门设置","删除",now(),OName ,OIP,request("OpeDesc"),"",ObjDB)
'添加日志结束
ObjDB.Close
Set ObjDB = Nothing
Response.Redirect "List.asp?ParentID=" & Request.QueryString("ParentID")
else
call MsgBox("该部门下有岗位信息,清把岗位信息清空后再删除!","Back","none")
response.end
end IF
else
call MsgBox("该部门下有子部门,不能删除!","Back","none")
response.end
end IF
else
call MsgBox("原因不能为空!","Back","none")
response.End()
end if
end if
%>
<BODY >
<table width="100%" border="0">
<tr>
<td>请填写删除原因! </td>
</tr>
<tr>
<td><form name="form1" method="post" action="">
<p>
<textarea name="OpeDesc" id="OpeDesc" rows="10" cols="60"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="提 交" class=Button>
</p>
</form></td>
</tr>
</table>
</BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -