📄 post_back.asp
字号:
<%@ Language=VBScript Transaction="Required"%>
<!--#include file="../Include/conn.asp"-->
<!--#include file="../Include/Syscheck.asp"-->
<%
call checkin_sys(session("UsersId"),session("PerId"),2)
Response.CharSet="GB2312"
dim op,post_hi,p_name,level_id,reason
op=Request.QueryString("op")
dim res
set res = server.CreateObject("adodb.recordset")
if op="1" then
p_name=Request.QueryString("hi")
on error resume next
res.Open "select post_name from post where post_name='"&p_name&"' and post_state='启用'",conn,3,3
if err.number<>0 then
Response.Write "输入非法字符!"
else
if res.BOF<>true or res.EOF<>true then
Response.Write "此岗位名已存在!"
end if
end if
elseif op="1_1" then
p_name=Request.QueryString("hi")
post_id=Request.QueryString("id")
res.Open "select post_name from post where post_name='"&p_name&"' and post_state='启用' and post_id!="&post_id,conn,3,3
if err.number<>0 then
Response.Write "输入非法字符!"
else
if res.BOF<>true or res.EOF<>true then
Response.Write "此岗位名已存在!"
end if
end if
elseif op="2" then
post_hi=Request.QueryString("hi")
'Response.Write post_hi&op
'Response.End
res.Open "select post_id from personnel where post_id="&post_hi,conn,3,3 '查询是否有员工绑定
if res.BOF=true and res.EOF=true then
on error resume next
conn.execute "update post set post_state='撤消' where post_id="&post_hi '更改状态
conn.execute "delete postlevel where post_id="&post_hi '删除与行政级别的绑定
conn.execute "delete deptpost where post_id="&post_hi '删除与部门的绑定
if err.number<>0 then
ObjectContext.setAbort '事务回滚
Response.Write "撤消失败!"
else
ObjectContext.setComplete '事务提交
Response.Write "已撤消!"
end if
else
Response.Write "该级别有员工绑定,撤消前请先更新员工表!"
end if
elseif op="3" then
level_id=Request.QueryString("hi")
post_hi=Request.QueryString("post")
'Response.Write level_id&","&post_hi
'Response.End
res.Open "select plevel_id from personnel where post_id="&post_hi&" and plevel_id="&level_id&" and personnel_state!='离职'",conn,1,1
if res.BOF=true and res.EOF=true then
Response.Write ""
else
Response.Write "已有人员分配!"
end if
end if
if res.State=1 then
res.close
end if
conn.close
set res = nothing
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -