📄 addnew.asp
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/Page.asp" -->
<!-- #include virtual="include/SelectValue.asp" -->
<%
If Request.Form.Count > 0 Then
Dim ObjDB,ObjRS,ObjRS1
Dim C
Dim StrSelectTrueName,IntParentID,rs,sql,SqlDep
' -------------------------------------------判断开始'
if request("_DepName")="" then
call MsgBox("部门名称不能为空!","Back","none")
response.end
else
if Len(request("_DepName"))>50 then
call MsgBox("部门名称超出50个汉字了了!","Back","none")
response.end
end if
end if
if request("_Peo")<>"" then
if Len(request("_Peo"))>50 then
call MsgBox("部门人数超出50个汉字了了!","Back","none")
response.end
end if
end if
if request("_Func")<>"" then
if Len(request("_Func"))>50 then
call MsgBox("部门功能超出50个汉字了了!","Back","none")
response.end
end if
end if
' -------------------------------------------判断结束'
'新增
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB
IntParentID = Request.QueryString("ParentID")
Set rs = Server.CreateObject("ADODB.Recordset")
SqlDep="select Pos from T_Hrms_Dep_Account Where DepID="&IntParentID
Set ObjRS = objDB.Execute(SqlDep)
if ObjRS.eof then
sql="select * from T_Hrms_Dep"
rs.open sql,ObjDB,3,3
Sql="select Count(*) from T_Hrms_Dep where DepName='" & trim(request("_DepName"))&"' and ParentID="&IntParentID
Set ObjRS1 = ObjDB.Execute(Sql)
if ObjRS1(0) = 0 Then
rs.addnew
rs("DepName")=request("_DepName")
rs("Survey")=request("_Survey")
rs("Func")=request("_Func")
rs("Peo")=request("_Peo")
rs("ParentID")=IntParentID
rs.update
'添加日志
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,"","",ObjDB)
'日志结束
rs.close
ObjDB.Close
Set ObjDB = Nothing
Response.Redirect ("List.asp?ParentID=" & IntParentID)
else
call MsgBox("该名称已经存在了!","Back","none")
response.end
end IF
else
call MsgBox("在新增下属部门前,请把该部门的岗位信息清空!","GoUrl","list.asp?ParentID=" & IntParentID)
response.end
end if'-----------判断重复结束
End If
%>
<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>
<form action="" method="post" id=form1 name=form1>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr>
<td width="15%">新增部门</td>
<td width="85%"> </td>
</tr>
<input Type=hidden name="_ParentID" value=<%=IntParentID%>>
<tr class=Ltr>
<td>部门名称</td>
<td><input name="_DepName" type="text" class=Input size="30" Check=1 Show="部门名称"></td>
</tr>
<tr class=Ltr>
<td>部门概况</td>
<td><textarea name="_Survey" cols="60" rows="10" class="Input" id="_Survey" check="1" show="部门名称"></textarea></td>
</tr>
<tr class=Ltr>
<td>部门功能</td>
<td><input name="_Func" type="text" class=Input id="_Func" Check=1 Show="部门名称"></td>
</tr>
<tr class=Ltr>
<td>部门人数</td>
<td><input name="_Peo" type="text" class=Input id="_Peo" Check=1 Show="部门名称"></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 file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -