⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addnew.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.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("_JobBegDate")<>"" then
  if  NOT IsDate(request("_JobBegDate")) then
  
 call MsgBox("必须是日期!","Back","none")

    response.end  
  end if 
  end if
  
   if request("_JobName")="" then
    call MsgBox("名称不能为空!","Back","none")
    response.end  
	 else
		  if Len(request("_JobName"))>20 then
		   call MsgBox("名称超出20个汉字了!","Back","none")
          response.end  
		  end if
  end if
    if request("_JobBrief")<>"" then
 		  if Len(request("_JobBrief"))>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_Job"
rs.open sql,ObjDB,3,3
Sql="select Count(*) from T_Hrms_Sys_Job where JobName='" & trim(request("_JobName"))&"'"
      Set ObjRS = ObjDB.Execute(Sql)
      if ObjRS(0) = 0 Then

rs.addnew

rs("JobName")=request("_JobName")
rs("JobBrief")=request("_JobBrief")



if  request("_JobBegDate")<>""  then
if  IsDate (request("_JobBegDate")) then
rs("JobBegDate")=request("_JobBegDate")
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="_JobName" type="text" class=Input id="_JobName" Check=0></td>
    </tr>
    <tr class=Ltr> 
      <td align="center">简介</td>
      <td><textarea name="_JobBrief" cols="60" rows="10" class="Input" id="_JobBrief" check="0"></textarea></td>
    </tr>
    <tr class=Ltr> 
      <td align="center">开始时间</td>
      <td><input  name="_JobBegDate" type="text" class=Input id="_JobBegDate"  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 + -