edit.asp

来自「功能齐全的oa系统」· ASP 代码 · 共 161 行

ASP
161
字号
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/Page.asp" -->

<%
	Dim ObjDB
	Dim C
	Dim IntID,IntParentID
  Dim rs,sql,ObjRS,ObjRS1
	
	IntID       = Request.QueryString("ID")
	IntParentID = Request.QueryString("ParentID")

  
	
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDBH ObjDB

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

	If Request.Form.Count > 0 Then
		IntID = Request.Form("ID")
			 ' -------------------------------------------判断开始'

  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 rs = Server.CreateObject("ADODB.Recordset")
  sql="select *  from T_Hrms_Dep Where ID="&IntID
 rs.open sql,ObjDB,3,3
 
	 	        Sql="select Count(*) from T_Hrms_Dep where DepName='" & trim(request("_DepName"))&"'"
            Set ObjRS1 = ObjDB.Execute(Sql)
           if   trim(rs("DepName"))<>trim(request("_DepName")) then
               if ObjRS1(0) = 0 Then
                rs("DepName")=request("_DepName")
              else
               call MsgBox("该名称已经存在了!","Back","none")
               response.end  
             end IF
      end if 
 rs("DepName")=request("_DepName")
rs("Survey")=request("_Survey")
rs("Func")=request("_Func")
rs("Peo")=request("_Peo")
'rs("ParentID")=IntID 

rs.update

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

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

call AddLog("部门管理","部门信息","修改",now(),OName ,OIP,"",OChang,ObjDB)
 '添加日志结束
set rs=nothing
ObjDB.Close
Set ObjDB = Nothing

  
%>
<script language=javascript>
parent.doList()
</script>
<%
		Response.End 
	End If

	Set ObjRS = C.View("Select * From T_Hrms_Dep Where ID = " & IntID)
	
	ObjDB.Close
	Set ObjDB = Nothing

%>


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

	
	<form action="" method="post" onsubmit="return(CheckForm(this))" id=form1 name=form1>
	<input type=hidden name=ID value="<%=IntID%>">
	<table class=Ltable cellspacing=1 cellpadding=3>
	<tr class=LHtr>
		<td width="15%">修改部门</td>
		<td width="85%"><%=IntID%></td>
	</tr>
	<tr class=Ltr>
		<td>部门名称</td>
		<td><input name="_DepName" type="text" class=Input   id="_DepName" value=<%=ObjRS("DepName")%> size="30"></td>
	</tr>
		<tr class=Ltr>
		
      <td>部门概况</td>
		<td><textarea name="_Survey" cols="60" rows="10" class="Input"   id="_Survey" ><%=ObjRS("Survey")%></textarea></td>
	</tr>
	<tr class=Ltr>
		
      <td>部门功能</td>
		<td><input name="_Func" type="text" class=Input id="_Func"  value="<%=ObjRS("Func")%>"></td>
	</tr>
	<tr class=Ltr>
		
      <td>部门人数</td>
		<td><input name="_Peo" type="text" class=Input id="_Peo"  value="<%=ObjRS("Peo")%>"></td>
	</tr>
	<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 + =
减小字号Ctrl + -
显示快捷键?