rizhisave.asp

来自「网佳网络办公系统(以下简称OA)是一套基于B/S模式的无纸化办公系统。[显著特点」· ASP 代码 · 共 99 行

ASP
99
字号
<%action=request.querystring("action")
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("hg_connstr")
conn.open connstr
ljldj=Session("hxf_u_grade")
         a4=session("hxf_u_nickname")
         a7=request.form("a4")
         action=request("action")
         a1=request.form("a1")
	     a2=request.form("a2")
         a3=request.form("a3")
         a5=request.form("a5")
         a6=request.form("a6")
         if a5="" then a5="无"
'检验数据合法性
if a1="" or a2="" or a3=""   then
%>
<script language=vbscript> 
MsgBox "错误:输入不能有空,没有信息的请填写[不详]!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%else
if action=30 then
set   tablelist=conn.execute("select  * from  工作日志  where a2='" &a2 &"'")
end if
if action=35 then
set   tablelist=conn.execute("select  * from  记事本  where a2='" &a2 &"'")
end if
if action=41 then
set   tablelist=conn.execute("select  * from  值班  where a2='" &a2 &"'")
end if
if action=42 then
set   tablelist=conn.execute("select  * from  档案  where a2='" &a2 &"'")
end if

if not(tablelist.eof and tablelist.bof) then
%>
<script language=vbscript> 
MsgBox "错误:数据库中已经存在此此信息,禁止重复提交!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%else

'写入记录
if action=30 then
	sql="SELECT * FROM 工作日志 WHERE 有效=true"
	set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
		id=rs("id")
		sql="update 工作日志 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
		conn.Execute(sql)
	else 
conn.execute("insert into 工作日志(a1,a2,a3,a4)  values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"')")
end if
end if
if action=35 then
	sql="SELECT * FROM 记事本 WHERE 有效=true"
	set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
		id=rs("id")
		sql="update 记事本 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
		conn.Execute(sql)
	else 
conn.execute("insert into 记事本(a1,a2,a3,a4,a5)  values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"','" &a5&"')")
end if
end if
if action=41 then
	sql="SELECT * FROM 值班 WHERE 有效=true"
	set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
		id=rs("id")
		sql="update 值班 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a4&"',有效=false where id="&id
		conn.Execute(sql)
	else 
conn.execute("insert into 值班(a1,a2,a3,a4,a5)  values('" &a1 &"','" &a2 &"','" &a3 &"','" &a4&"','" &a5&"')")
end if
end if
if action=42 then
	sql="SELECT * FROM 档案 WHERE 有效=true"
	set rs=conn.Execute(sql)
If not(Rs.Bof OR Rs.Eof) Then
		id=rs("id")
		sql="update 档案 set a1='"&a1&"',a2='"&a2&"',a3='"&a3&"',a4='"&a7&"',a5='"&a5&"',a6='"&a6&"',a7='"&a4&"',有效=false where id="&id
		conn.Execute(sql)
	else 
conn.execute("insert into 档案(a1,a2,a3,a4,a5,a6,a7)  values('" &a1 &"','" &a2 &"','" &a3 &"','" &a7&"','" &a5&"','" &a6&"','" &a4&"')")
end if
end if
%>
<script language=vbscript> 
MsgBox "系统提示:提交成功,按此返回!"
location.href = "rizhi.asp?action=<%=action%>"
</script>
<%end if
conn.close
set conn=nothing
end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?