📄 addnew.asp
字号:
<% option explicit%>
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/DataEnvi.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
If Request.Form.Count > 0 Then
Dim ObjDB
Dim C
Dim IntID,rs,sql,ObjRS
' ----------------------------------------判断开始'
if request("_ReaBegDate")<>"" then
if NOT IsDate(request("_ReaBegDate")) then
call MsgBox("必须是日期!","Back","none")
response.end
end if
end if
if request("_Reason")="" then
call MsgBox("名称不能为空!","Back","none")
response.end
else
if Len(request("_Reason"))>20 then
call MsgBox("名称超出20个汉字了!","Back","none")
response.end
end if
end if
if request("_ReaBrief")<>"" then
if Len(request("_ReaBrief"))>500 then
call MsgBox("简介超出500个汉字了!","Back","none")
response.end
end if
end if
' -------------------------------------------判断结束'
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDBH ObjDB
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from T_Hrms_Sys_AppReason"
rs.open sql,ObjDB,3,3
Sql="select Count(*) from T_Hrms_Sys_AppReason where Reason='" & trim(request("_Reason"))&"'"
Set ObjRS = ObjDB.Execute(Sql)
if ObjRS(0) = 0 Then
rs.addnew
rs("Reason")=request("_Reason")
rs("ReaBrief")=request("_ReaBrief")
if request("_ReaBegDate")<>"" then
if IsDate (request("_ReaBegDate")) then
rs("ReaBegDate")=request("_ReaBegDate")
end if
end if
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"
else
call MsgBox("该名称已经存在了!","Back","none")
response.end
end IF
End If
Sub Main
%>
<HTML><HEAD>
<form action="" method="post" onsubmit="return(CheckForm(this))">
<input type=hidden name=_AccountID value=<%=Session("AccountID")%>>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr align="middle">
<td width="15%">新增申请理由类型</td>
<td width="85%"> </td>
</tr>
<tr class=Ltr>
<td align="center">名称</td>
<td><input name="_Reason" type="text" class=Input id="_Reason" Check=0></td>
</tr>
<tr class=Ltr>
<td align="center">简介</td>
<td><textarea name="_ReaBrief" cols="60" rows="10" class="Input" id="_ReaBrief" check="0"></textarea></td>
</tr>
<tr class=Ltr>
<td align="center">开始时间</td>
<td><input name="_ReaBegDate" type="text" class=Input id="_ReaBegDate" onclick="InputDate(this)" Check=0>
</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 virtual="Templet/Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -