%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
Insert - Update Event
<%
CheckSecurity(1)
CBNewCustomer = GetParam("AddCustIntList")
Customer = ""
Customer = GetParam("CustInt")
CustomerList = GetParam("CustIntList")
DateIntervention = GetParam("DateInterv")
IdEmpl = GetParam("IdEmpl")
BTH = GetParam("BeginTimeHour")
BTM = GetParam("BeginTimeMinutes")
ETH = GetParam("EndTimeHour")
ETM = GetParam("EndTimeMinutes")
CBFullDay = GetParam("FullDay")
JD = GetParam("JobDescription")
''''''''''''''''''''''''''''''''''''''''''''''
' Vérification avant encodage nouveau client '
''''''''''''''''''''''''''''''''''''''''''''''
If CBNewCustomer = "on" AND Customer = "" then
Response.Redirect("EBAddNewEvent.asp?DateInterv=" & DateIntervention & "&IdEmpl=" & IdEmpl & "&BTH=" & BTH & "&BTM=" & BTM & "Ð=" & ETH & "&ETM=" & ETM & "&CBNC=" & CBNewCustomer & "&CBFD=" & CBFullDay & "&CustInt=" & Customer & "&CustIntList=" & CustomerList & "&JD=" & JD & "&Mess=1")
End if
If CustomerList = 1 AND Customer = "" then
Response.Redirect("EBAddNewEvent.asp?DateInterv=" & DateIntervention & "&IdEmpl=" & IdEmpl & "&BTH=" & BTH & "&BTM=" & BTM & "Ð=" & ETH & "&ETM=" & ETM & "&CBNC=" & CBNewCustomer & "&CBFD=" & CBFullDay & "&CustInt=" & Customer & "&CustIntList=" & CustomerList & "&JD=" & JD & "&Mess=2")
End if
'''''''''''''''''''''''''''
' Encodage nouveau client '
'''''''''''''''''''''''''''
If CBNewCustomer = "on" then
checkCli = ""
checkCli = DLookUp("custint", "Customer", "Customer='" & Customer & "'")
If checkCli = "" then
Set rsInsertCli = Server.CreateObject("ADODB.Recordset")
sqlInsertCli = "insert into custint (" & _
"Customer)" & _
" values (" & _
ToSQL(Customer, "Text") & _
")"
openrs rsInsertCli, sqlInsertCli
End if
End if
If Customer = "" then
Customer = DLookUp("custint", "Customer", "id=" & CustomerList & "")
end if
If CBFullDay = "on" then
FullDay = 1
BeginTime = "00:00:00"
EndTime = "24:00:00"
else
FullDay = 0
tmp = 0
tmp2 = 0
If BTH > ETH then
tmp = BTH
tmp2 = ETH
BTH = tmp2
ETH = tmp
tmp = BTM
tmp2 = ETM
BTM = tmp2
ETM = tmp
end if
If BTH = ETH then
If BTM = ETM then
ETH = ETH + 1
end if
If BTM > ETM then
tmp = BTH
tmp2 = ETH
BTH = tmp2
ETH = tmp
tmp = BTM
tmp2 = ETM
BTM = tmp2
ETM = tmp
end if
end if
If BTH < 10 then
BTH = "0" & BTH
end if
If BTM < 10 then
BTM = "0" & BTM
end if
BeginTime = BTH & ":" & BTM & ":00"
If ETH < 10 then
ETH = "0" & ETH
end if
If ETM < 10 then
ETM = "0" & ETM
end if
EndTime = ETH & ":" & ETM & ":00"
end if
WeekNumInt = DatePart("ww",DateIntervention,2,3)
idInt = ""
set rs1 = Server.CreateObject("ADODB.recordset")
SQL1 = "insert into reldatelieupers_2 (" & _
"DateInt," & _
"CustInt," & _
"idEmpl," & _
"FullDay," & _
"BeginTime," & _
"EndTime," & _
"JobDescription)" & _
" values (" & _
ToSQL(DateIntervention, "Text") & "," & _
ToSQL(Customer, "Text") & "," & _
ToSQL(IdEmpl, "Number") & "," & _
ToSQL(FullDay, "Number") & "," & _
ToSQL(BeginTime, "Text") & "," & _
ToSQL(EndTime, "Text") & "," & _
ToSQL(JD, "Text") & _
")"
openrs rs1, SQL1
Response.Redirect("EBAgenda.asp?Semaine=" & WeekNumInt & "")
%>