📄 useinsert6.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../getlevel.asp"-->
<html>
<body bgcolor="#567D30">
<%
equipid=request.form("mmeq1")
name5=request.form("eqname4")
fixunit=request.form("mmeq2")
fixtime=request.form("mmeq3")
sender=request.form("mmeq4")
fixtype=request.form("mmeq5")
faultreason=request.form("mmeq6")
dealthing=request.form("mmeq7")
equipmentused=request.form("mmeq8")
motorhour=request.form("mmeq9")
overtime=request.form("mmeq10")
%>
<%
name4=mid(name5,3)
tableid=left(name5,2)
ttime=cstr(cint(year(date()))*10000+cint(month(date()))*100+cint(day(date())))
kind="大型装备"
'判断是否已经存在该设备的信息
set rs = server.createobject("adodb.recordset")
sql="select * from h_mend where equipid='"&equipid&"' and ttime='"&ttime&"'"
rs.open sql,conn, 1, 1
if not rs.bof or not rs.eof then
response.write "<script language='javascript'>"
response.write "alert('记录已经录入!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
set rs=nothing
else
%>
<%
if tableid="31" then
set rs = server.createobject("adodb.recordset")
sql="select * from tk_equipment "&condition&" and totalid='"&equipid&"'"
rs.open sql,conn, 1, 1
if not rs.bof or not rs.eof then
combatconsume=cstr(clng(rs("combatconsume"))+clng(equipmentused))
coachconsume=cstr(clng(rs("coachconsume"))+clng(equipmentused))
if month(date())=1 and day(date())=1 then
combatconsume=equipmentused
coachconsume=equipmentused
end if
brcount=rs("brcount")
mrcount=rs("mrcount")
srcount=rs("srcount")
checkcount=rs("checkcount")
faultcount=rs("faultcount")
if fixtype="大修在修" then
brcount=brcount+1
else if fixtype="中修在修" then
mrcount=mrcount+1
else if fixtype="小修在修" then
srcount=srcount+1
else if fixtype="检修在修" then
checkcount=checkcount+1
else if fixtype="故障在修" then
faultcount=faultcount+1
end if
end if
end if
end if
end if
sql="update mtk_equipment set"
sql=sql+" combatconsume='"&combatconsume&"',"
sql=sql+" coachconsume='"&coachconsume&"',"
sql=sql+" brcount='"&brcount&"',"
sql=sql+" mrcount='"&mrcount&"',"
sql=sql+" srcount='"&srcount&"',"
sql=sql+" checkcount='"&checkcount&"',"
sql=sql+" faultcount='"&faultcount&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
conn.Execute(sql)
'rs.close
set rs=nothing
end if
else if tableid="32" then
set rs = server.createobject("adodb.recordset")
sql="select * from ca_equipment "&condition&" and equipid='"&equipid&"'"
rs.open sql,conn, 1, 1
if not rs.bof or not rs.eof then
brcount=rs("brcount")
mrcount=rs("mrcount")
srcount=rs("srcount")
faultcount=rs("faultcount")
checkcount=rs("checkcount")
if fixtype="大修在修" then
brcount=brcount+1
lastbrdate=ttime
else if fixtype="中修在修" then
mrcount=mrcount+1
lastbrdate=rs("lastbrdate")
else if fixtype="小修在修" then
srcount=srcount+1
else if fixtype="检修在修" then
checkcount=checkcount+1
else if fixtype="故障在修" then
faultcount=faultcount+1
end if
end if
end if
end if
end if
sql="update ca_equipment set"
sql=sql+" brcount='"&brcount&"',"
sql=sql+" mrcount='"&mrcount&"',"
sql=sql+" srcount='"&srcount&"',"
sql=sql+" checkcount='"&checkcount&"',"
sql=sql+" faultcount='"&faultcount&"',"
sql=sql+" lastbrdate='"&lastbrdate&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and equipid='"&equipid&"'"
conn.Execute(sql)
rs.close
set rs=nothing
end if
else if tableid="34" then
set rs = server.createobject("adodb.recordset")
sql="select * from en_equipment "&condition&" and totalid='"&equipid&"'"
rs.open sql,conn, 1, 1
if not rs.bof or not rs.eof then
brcount=rs("brcount")
mrcount=rs("mrcount")
srcount=rs("srcount")
checkcount=rs("checkcount")
faultcount=rs("faultcount")
yearused=cstr(clng(rs("yearused"))+clng(equipmentused))
alreadyused=cstr(clng(rs("alreadyused"))+clng(equipmentused))
if month(date())=1 and day(date())=1 then
yearused=equipmentused
end if
if fixtype="大修在修" then
brcount=brcount+1
sql="update en_vehicle set"
sql=sql+" brcount='"&brcount&"',"
sql=sql+" brdate='"&fixtime&"',"
sql=sql+" brover='"&overtime&"',"
sql=sql+" yearused='"&yearused&"',"
sql=sql+" alreadyused='"&alreadyused&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="中修在修" then
mrcount=mrcount+1
sql="update en_vehicle set"
sql=sql+" mrcount='"&mrcount&"',"
sql=sql+" mrdate='"&fixtime&"',"
sql=sql+" mrover='"&overtime&"',"
sql=sql+" yearused='"&yearused&"',"
sql=sql+" alreadyused='"&alreadyused&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="小修在修" then
srcount=srcount+1
sql="update en_vehicle set"
sql=sql+" srcount='"&srcount&"',"
sql=sql+" srdate='"&fixtime&"',"
sql=sql+" yearused='"&yearused&"',"
sql=sql+" alreadyused='"&alreadyused&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="检修在修" then
checkcount=checkcount+1
sql="update en_vehicle set"
sql=sql+" checkcount='"&checkcount&"',"
sql=sql+" yearused='"&yearused&"',"
sql=sql+" alreadyused='"&alreadyused&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="故障在修" then
faultcount=faultcount+1
sql="update en_vehicle set"
sql=sql+" faultcount='"&faultcount&"',"
sql=sql+" yearused='"&yearused&"',"
sql=sql+" alreadyused='"&alreadyused&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
end if
end if
end if
end if
end if
conn.Execute(sql)
set rs=nothing
end if
else if tableid="33" then
set rs = server.createobject("adodb.recordset")
sql="select * from vo_equipment "&condition&" and equipid='"&equipid&"'"
rs.open sql,conn, 1, 1
if not rs.bof or not rs.eof then
brcount=rs("brcount")
mrcount=rs("mrcount")
srcount=rs("srcount")
checkcount=rs("checkcount")
faultcount=rs("faultcount")
lrdate=ttime
if fixtype="大修在修" then
brcount=brcount+1
else if fixtype="中修在修" then
mrcount=mrcount+1
else if fixtype="小修在修" then
srcount=srcount+1
else if fixtype="检修在修" then
checkcount=checkcount+1
else if fixtype="故障在修" then
faultcount=faultcount+1
end if
end if
end if
end if
end if
sql="update vo_equipment set"
sql=sql+" brcount='"&brcount&"',"
sql=sql+" mrcount='"&mrcount&"',"
sql=sql+" srcount='"&srcount&"',"
sql=sql+" checkcount='"&checkcount&"',"
sql=sql+" faultcount='"&faultcount&"',"
sql=sql+" lrdate='"&lrdate&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and equipid='"&equipid&"'"
conn.Execute(sql)
rs.close
set rs=nothing
end if
else if tableid="35" then
set rs = server.createobject("adodb.recordset")
sql="select * from fh_equipment "&condition&" and totalid='"&equipid&"'"
rs.open sql,conn, 1, 1
if not rs.bof or rs.eof then
brcount=rs("brcount")
mrcount=rs("mrcount")
srcount=rs("rsrcount")
checkcount=rs("checkcount")
faultcount=rs("faultcount")
yteexpend=cstr(clng(rs("yteexpend"))+clng(equipmentused))
pyeexpend=cstr(clng(rs("pyeexpend"))+clng(equipmentused))
if month(date())=1 and day(date())=1 then
yteexpend=equipmentused
end if
if fixtype="大修在修" then
brcount=brcount+1
sql="update en_vehicle set"
sql=sql+" brcount='"&brcount&"',"
sql=sql+" rbrtime='"&fixtime&"',"
sql=sql+" rbrover='"&overtime&"',"
sql=sql+" yteexpend='"&yteexpend&"',"
sql=sql+" pyeexpend='"&pyeexpend&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="中修在修" then
mrcount=mrcount+1
sql="update en_vehicle set"
sql=sql+" mrcount='"&mrcount&"',"
sql=sql+" rmrtime='"&fixtime&"',"
sql=sql+" rmrover='"&overtime&"',"
sql=sql+" yteexpend='"&yteexpend&"',"
sql=sql+" pyeexpend='"&pyeexpend&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="小修在修" then
srcount=srcount+1
sql="update en_vehicle set"
sql=sql+" rsrcount='"&srcount&"',"
sql=sql+" rsrtime='"&fixtime&"',"
sql=sql+" yteexpend='"&yteexpend&"',"
sql=sql+" pyeexpend='"&pyeexpend&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="检修在修" then
checkcount=checkcount+1
sql="update en_vehicle set"
sql=sql+" checkcount='"&checkcount&"',"
sql=sql+" yteexpend='"&yteexpend&"',"
sql=sql+" pyeexpend='"&pyeexpend&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
else if fixtype="小修在修" then
srcount=srcount+1
sql="update en_vehicle set"
sql=sql+" faultcount='"&faultcount&"',"
sql=sql+" yteexpend='"&yteexpend&"',"
sql=sql+" pyeexpend='"&pyeexpend&"',"
sql=sql+" fixcondition='"&fixtype&"' "
sql=sql+condition+ "and totalid='"&equipid&"'"
end if
end if
end if
end if
end if
conn.Execute(sql)
set rs=nothing
end if
end if
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -