61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
<!-- #include virtual = "lib/config.asp" -->
|
|
<%
|
|
set dbin = server.CreateObject("ADODB.CONNECTION")
|
|
|
|
p_child_sn = request("p_child_sn")
|
|
use_ed_dt = request("use_ed_dt")
|
|
man_id = request("man_id")
|
|
device_id = request("device_id")
|
|
|
|
if man_id = "" then
|
|
man_value = "MAN_ID"
|
|
else
|
|
man_value = "'" & man_id & "'"
|
|
end if
|
|
|
|
Response.CharSet = "EUC-KR" 'ÇѱÛ
|
|
Response.AddHeader "Pragma","no-cache"
|
|
Response.AddHeader "cache-control", "no-staff"
|
|
Response.Expires = -1
|
|
|
|
query = ""
|
|
query = query & " SELECT ID "
|
|
query = query & " FROM project2.dbo.T_DEVICE_USE "
|
|
query = query & " WHERE DEVICE_ID = " & device_id & " AND USE_YN = 'Y' "
|
|
|
|
Rs.Open Query, adoConn, 1
|
|
if Rs.recordCount > 0 then
|
|
row_id = Rs("ID")
|
|
else
|
|
row_id = "0"
|
|
end if
|
|
Rs.close
|
|
|
|
if cint(row_id) > 0 then
|
|
query = ""
|
|
query = query & " UPDATE project2.dbo.T_DEVICE_USE "
|
|
query = query & " SET USE_YN = 'N', MODIFY_DT = getdate() "
|
|
query = query & " WHERE ID = " & row_id & " "
|
|
|
|
dbin.Open adoConn
|
|
dbin.Execute query, i
|
|
dbin.Close
|
|
|
|
if i > 0 Then
|
|
query = ""
|
|
query = query & " INSERT INTO project2.dbo.T_DEVICE_USE "
|
|
query = query & " (DEVICE_ID, P_CHILD_SN, USE_ST_DT, USE_ED_DT, MAN_ID, USE_YN, D_NO, MODIFY_DT, INSERT_DT, INSERT_USER) "
|
|
query = query & " SELECT " & device_id & ", '" & p_child_sn & "', USE_ST_DT, '" & use_ed_dt & "', " & man_value & ", 'Y', D_NO, getdate(), getdate(), INSERT_USER "
|
|
query = query & " FROM project2.dbo.T_DEVICE_USE "
|
|
query = query & " WHERE ID = " & row_id & " "
|
|
|
|
dbin.Open adoConn
|
|
dbin.Execute query
|
|
dbin.Close
|
|
|
|
response.Write "1"
|
|
else
|
|
response.Write "0"
|
|
end if
|
|
end if
|
|
%> |