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

📄 edit.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="Include/Page.asp" -->
<!-- #include virtual="Include/SelectValue.asp" -->

<%
	Dim ObjDB
	Dim C
	Dim IntID
	Dim ObjRS,rs,sql
	
	IntID = Request.QueryString("ID")
	
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDBH ObjDB

	Set C = Server.CreateObject ("CMS2003.DBhandle")
	C.Init(ObjDB)

	If Request.Form.Count > 0 Then
 ' ----------------------------------------判断开始'	
	 if request("_Fee")<>"" then
       if  NOT IsNumeric(request("_Fee")) then
       call MsgBox("费用必须是数字!","Back","none")
	    response.end  
		else
		if request("_Fee")<0 or request("_Fee")>9999 then
		call MsgBox("费用超出范围,请填写0-9999之间的数值!","Back","none")
	    response.end 
		end if
  end if 
  end if
  
    if request("_Score")<>"" then
  if  NOT IsNumeric(request("_Score")) then
  call MsgBox("成绩必须是数字!","Back","none")
     response.end  
	 else
	 if  request("_Score")>100 or request("_Score")<0 then
	 call MsgBox("成绩超出范围,请填写0-100之间的数值!","Back","none")
	 response.end  
	 end if
  end if 
    end if
	
   if request("_LesTime")<>"" then
  if  NOT IsNumeric(request("_LesTime")) then
     call MsgBox("培训时限必须是数字!","Back","none")
    response.end  
	 else
	 if  request("_LesTime")>365 or request("_LesTime")<0 then
	 call MsgBox("培训时限超出范围,请填写0-100之间的数值!","Back","none")
	 response.end  
	 end if
  end if 
  end if
  
  
  if request("_BeginTime")<>"" then
  if  NOT IsDate(request("_BeginTime")) then
       call MsgBox("必须是日期!","Back","none")
     response.end  
  end if 
  end if
  
    if request("_EndTime")<>"" then
  if  NOT IsDate(request("_EndTime")) then
         call MsgBox("必须是日期!","Back","none")
    response.end  
  end if 
  end if
  
  if request("_LesName")="" then
         call MsgBox("名称不能为空!","Back","none")
          response.end  
		  else
		  if Len(request("_LesName"))>20 then
		   call MsgBox("名称超出20个字符了!","Back","none")
          response.end  
		  end if
  end if
 ' -------------------------------------------判断结束'
'修改		
Set rs = Server.CreateObject("ADODB.Recordset")
  sql="select *  from T_Hrms_Employees_Train_Record Where ID="&IntID
 rs.open sql,ObjDB,3,3
 rs("LesCode")=request("_LesCode")
rs("LesName")=request("_LesName")

if  request("_LesTime")<>"" then
if IsNUMERIC(request("_LesTime")) then
rs("LesTime")=request("_LesTime")
end if
end if

if  not IsEmpty(request("_BeginTime"))  then
if  IsDate (request("_BeginTime")) then
rs("BeginTime")=request("_BeginTime")
end if
end if

if  not IsEmpty(request("_EndTime"))  then
if  IsDate (request("_EndTime")) then
rs("EndTime")=request("_EndTime")
end if
end if

if  request("_Score")<>"" then
rs("Score")=request("_Score")
end if
rs("TestResult")=request("_TestResult")

if  request("_Fee")<>"" then
rs("Fee")=request("_Fee")
end if

rs.update
'添加日志
dim FirstMenu,SecondMenu,Opertion,OTime,OName,OIP,ODesc,OChang
OIP=Request.ServerVariables("REMOTE_ADDR")
OName= Session("AccountName") 
if  isempty(OChang) then
      OChang=""
	  end if

if OName="administrator" then
OName="系统管理员"
end if

call AddLog("员工管理","培训纪录","修改",now(),OName ,OIP,"",OChang,ObjDB)

'日志结束
set rs=nothing
ObjDB.Close
Set ObjDB = Nothing
Response.Redirect "list.asp"   
End If
   
	Set ObjRS = C.View("Select * From T_Hrms_Employees_Train_Record Where ID = " & IntID)
		
	

	
%>



<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>

	
	<form action="" method="post"  id=form1 name=form1>
	<input type=hidden name=ID value="<%=Request.QueryString("ID")%>">
	<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><select type="text" class=Input Check=0  name="_LesCode"  style="width: 150;" >
	<%=SelectValueSingle(ObjDB,"Select ID,LesCode from T_Hrms_Employees_Train_Lesson",CStr(ObjRS("LesCode")))%>
	</SELECT></td>
  </tr>
  <tr class=Ltr>
      <td align="center">姓名</td>
    <td><select type="text" class=Input Check=0  name="_LesName"  style="width: 150;" >
	<%=SelectValueSingle(ObjDB,"Select ID,Name from t_Hrms_Employees_UsersBasic",CStr(ObjRS("LesName")))%>
	</SELECT>	
	</td>
  </tr>
  <tr class=Ltr>
      <td align="center">培训时限</td>
      <td><input type="text" class=Input check=0  name="_LesTime" value="<%=ObjRS("LesTime")%>">
        天</td>
  </tr>
  <tr class=Ltr>
      <td align="center">开始时间</td>
    <td><input type="text" class=Input Check=0  name="_BeginTime"  readonly="true"  onclick="InputDate(this)" value="<%=FormatDate(ObjRS("BeginTime"))%>"></td>
  </tr>
  <tr class=Ltr>
      <td align="center">结束时间</td>
    <td><input type="text" class=Input Check=0  name="_EndTime" readonly="true"   onclick="InputDate(this)" value="<%=FormatDate(ObjRS("EndTime"))%>"></td>
  </tr>
  <tr class=Ltr>
      <td align="center">成绩</td>
    <td><input type="text" class=Input Check=0  name="_Score" value="<%=ObjRS("Score")%>">
        分</td>
  </tr>
  <tr class=Ltr>
      <td align="center">测试</td>
    <td><%'response.write rs("TestResult")
	'response.End()%>
     <select type="text" class=Input Check=0  name="_TestResult"  style="width: 150;" >
	<option value="0"  <%if  ObjRS("TestResult")="1" then response.write "selected" end if%>>优</option>
	 <option value="1" <%if  ObjRS("TestResult")="1" then response.write "selected" end if%>>良</option>
	 <option value="2" <%if  ObjRS("TestResult")="2"then response.write "selected" end if%>>及格</option>
	 <option value="3" <%if  ObjRS("TestResult")="3" then response.write "selected" end if%>>差</option>
	</SELECT></td>
  </tr>
  <tr class=Ltr>
      <td align="center">费用</td>
    <td><input type="text" class=Input Check=0  name="_Fee" value="<%=ObjRS("Fee")%>">
        元</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 + -