<% ' ' Filename: convoyeurs.asp ' Generated with CodeCharge 2.0.5 ' ASP 2.0.ccp build 01/22/2002 ' '------------------------------- ' convoyeurs CustomIncludes begin %> <% ' convoyeurs CustomIncludes end '------------------------------- '=============================== ' Save Page and File Name available into variables '------------------------------- sFileName = "convoyeurs.asp" '=============================== '=============================== ' convoyeurs PageSecurity begin CheckSecurity(1) ' convoyeurs PageSecurity end '=============================== '=============================== ' convoyeurs Open Event start ' convoyeurs Open Event end '=============================== '=============================== ' convoyeurs OpenAnyPage Event start ' convoyeurs OpenAnyPage Event end '=============================== '=============================== ' Save the name of the form and type of action into the variables '------------------------------- sAction = GetParam("FormAction") sForm = GetParam("FormName") '=============================== ' convoyeurs Show begin '=============================== ' Page execution '------------------------------- 'Initialize error variables '------------------------------- srelcliinstallconv1Err = "" '------------------------------- ' Select the FormAction '------------------------------- Select Case sForm Case "relcliinstallconv1" relcliinstallconv1Action(sAction) end select '=============================== '=============================== ' HTML Page layout '------------------------------- %> EB Customers 1.09
<% MenuGeneral2_Show %>
<% MenuGeneral_Show %>
<% relcliinstallconv_Show %>
<% relcliinstallconv1_Show %>
<% ' convoyeurs Show end ' convoyeurs Close Event start ' convoyeurs Close Event end '------------------------------- ' Destroy connection object '------------------------------- cn.close Set cn = nothing '=============================== '******************************************************************************** '=============================== ' Display Grid Form '------------------------------- Sub relcliinstallconv_Show() '------------------------------- ' Initialize variables '------------------------------- Dim rs Dim sWhere : sWhere = "" Dim sOrder : sOrder = "" Dim sSQL : sSQL = "" Dim sFormTitle: sFormTitle = "Convoyeurs" Dim HasParam : HasParam = false Dim iSort : iSort = "" Dim iSorted : iSorted = "" Dim sDirection : sDirection = "" Dim form_sorting : form_sorting = "" Dim sSortParams : sSortParams = "" Dim iRecordsPerPage : iRecordsPerPage = 200 Dim iCounter : iCounter = 0 Dim iPage : iPage = 0 Dim bEof : bEof = False Dim transit_params : transit_params = "" Dim form_params : form_params = "" '------------------------------- ' Build ORDER BY statement '------------------------------- sOrder = " order by r.idCli Asc" iSort = GetParam("Formrelcliinstallconv_Sorting") iSorted = GetParam("Formrelcliinstallconv_Sorted") sDirection = "" if IsEmpty(iSort) then form_sorting = "" else if iSort = iSorted then form_sorting = "" sDirection = " DESC" sSortParams = "Formrelcliinstallconv_Sorting=" & iSort & "&Formrelcliinstallconv_Sorted=" & iSort & "&" else form_sorting = iSort sDirection = " ASC" sSortParams = "Formrelcliinstallconv_Sorting=" & iSort & "&Formrelcliinstallconv_Sorted=" & "&" end if if iSort = 1 then sOrder = " order by e.FriendName" & sDirection if iSort = 2 then sOrder = " order by r1.Description" & sDirection if iSort = 3 then sOrder = " order by t.Name" & sDirection if iSort = 4 then sOrder = " order by r.numB2K" & sDirection if iSort = 5 then sOrder = " order by t1.Name" & sDirection if iSort = 6 then sOrder = " order by r.disjoncteurValeur" & sDirection if iSort = 7 then sOrder = " order by r.disjoncteurNum" & sDirection if iSort = 8 then sOrder = " order by r.disjoncteurSituation" & sDirection if iSort = 9 then sOrder = " order by r2.Name" & sDirection if iSort = 10 then sOrder = " order by t2.Name" & sDirection if iSort = 11 then sOrder = " order by r3.Name" & sDirection if iSort = 12 then sOrder = " order by t3.Name" & sDirection if iSort = 13 then sOrder = " order by t4.Name" & sDirection if iSort = 14 then sOrder = " order by r.note" & sDirection end if '------------------------------- ' HTML column headers '------------------------------- %> <% '------------------------------- ' Build base SQL statement '------------------------------- sSQL = "select r.disjoncteurNum as r_disjoncteurNum, " & _ "r.disjoncteurSituation as r_disjoncteurSituation, " & _ "r.disjoncteurValeur as r_disjoncteurValeur, " & _ "r.dymo as r_dymo, " & _ "r.id as r_id, " & _ "r.idCli as r_idCli, " & _ "r.idFT1 as r_idFT1, " & _ "r.idFT2 as r_idFT2, " & _ "r.idInst as r_idInst, " & _ "r.idTypeConv as r_idTypeConv, " & _ "r.idTypeRuban as r_idTypeRuban, " & _ "r.idVoltage as r_idVoltage, " & _ "r.note as r_note, " & _ "r.numB2K as r_numB2K, " & _ "r.ouvertureRail as r_ouvertureRail, " & _ "e.id as e_id, " & _ "e.FriendName as e_FriendName, " & _ "r1.id as r1_id, " & _ "r1.Description as r1_Description, " & _ "t.id as t_id, " & _ "t.Name as t_Name, " & _ "t1.id as t1_id, " & _ "t1.Name as t1_Name, " & _ "r2.id as r2_id, " & _ "r2.Name as r2_Name, " & _ "t2.id as t2_id, " & _ "t2.Name as t2_Name, " & _ "r3.id as r3_id, " & _ "r3.Name as r3_Name, " & _ "t3.id as t3_id, " & _ "t3.Name as t3_Name, " & _ "t4.id as t4_id, " & _ "t4.Name as t4_Name " & _ " from relcliinstallconv r, eb_clients e, relcliinstall r1, typeconv t, typevoltage t1, reponsequestion r2, typeruban t2, reponsequestion r3, typecomptage t3, typecomptage t4" & _ " where e.id=r.idCli and r1.id=r.idInst and t.id=r.idTypeConv and t1.id=r.idVoltage and r2.id=r.dymo and t2.id=r.idTypeRuban and r3.id=r.ouvertureRail and t3.id=r.idFT1 and t4.id=r.idFT2 " '------------------------------- '------------------------------- ' relcliinstallconv Open Event start ' relcliinstallconv Open Event end '------------------------------- '------------------------------- ' Assemble full SQL statement '------------------------------- sSQL = sSQL & sWhere & sOrder '------------------------------- '------------------------------- ' Open the recordset '------------------------------- openrs rs, sSQL '------------------------------- '------------------------------- ' Process empty recordset '------------------------------- if rs.eof then %> <% end if '------------------------------- '------------------------------- 'Initialize page counter and records per page '------------------------------- iRecordsPerPage = 200 iCounter = 0 '------------------------------- ' Process page scroller '------------------------------- iPage = GetParam("Formrelcliinstallconv_Page") if IsEmpty(iPage) then iPage = 1 else iPage = CLng(iPage) while not rs.eof and iCounter < (iPage-1)*iRecordsPerPage rs.movenext iCounter = iCounter + 1 wend iCounter = 0 '------------------------------- '------------------------------- ' Display grid based on recordset '------------------------------- while not rs.EOF and iCounter < iRecordsPerPage '------------------------------- ' Create field variables based on database fields '------------------------------- fldField1_URLLink = "relcliinstallconvporte.asp" fldField1_idInstConv = GetValue(rs, "r_id") fldField1_idCli = GetValue(rs, "r_idCli") fldField1_idInst = GetValue(rs, "r_idInst") flddisjoncteurNum = GetValue(rs, "r_disjoncteurNum") flddisjoncteurSituation = GetValue(rs, "r_disjoncteurSituation") flddisjoncteurValeur = GetValue(rs, "r_disjoncteurValeur") flddymo = GetValue(rs, "r2_Name") fldid = GetValue(rs, "r_id") fldidCli_URLLink = "convoyeurs.asp" fldidCli_id = GetValue(rs, "r_id") fldidCli = GetValue(rs, "e_FriendName") fldidFT1 = GetValue(rs, "t3_Name") fldidFT2 = GetValue(rs, "t4_Name") fldidInst = GetValue(rs, "r1_Description") fldidTypeConv = GetValue(rs, "t_Name") fldidTypeRuban = GetValue(rs, "t2_Name") fldidVoltage = GetValue(rs, "t1_Name") fldnote = GetValue(rs, "r_note") fldnumB2K = GetValue(rs, "r_numB2K") fldouvertureRail = GetValue(rs, "r3_Name") fldField1= "Portes" '------------------------------- ' relcliinstallconv Show begin '------------------------------- '------------------------------- ' relcliinstallconv Show Event start ' relcliinstallconv Show Event end '------------------------------- '------------------------------- ' Process the HTML controls '------------------------------- %> <% '------------------------------- ' relcliinstallconv Show end '------------------------------- '------------------------------- ' Move to the next record and increase record counter '------------------------------- rs.MoveNext iCounter = iCounter + 1 wend '------------------------------- '------------------------------- ' Process the bottom on the Grid. The insert link and record navigator. '------------------------------- if not (rs.EOF and iPage=1) then %> <% end if '------------------------------- ' relcliinstallconv Navigation end '------------------------------- '------------------------------- ' Finish form processing '------------------------------- set rs = nothing %>
<%=sFormTitle%>
idCli idInst idTypeConv numB2K Portes idVoltage disjoncteurValeur disjoncteurNum disjoncteurSituation dymo idTypeRuban ouvertureRail idFT1 idFT2 note
No records
<%=fldidCli%>  <%=ToHTML(fldidInst)%>  <%=ToHTML(fldidTypeConv)%>  <%=ToHTML(fldnumB2K)%>  <%=fldField1%>  <%=ToHTML(fldidVoltage)%>  <%=ToHTML(flddisjoncteurValeur)%>  <%=ToHTML(flddisjoncteurNum)%>  <%=ToHTML(flddisjoncteurSituation)%>  <%=ToHTML(flddymo)%>  <%=ToHTML(fldidTypeRuban)%>  <%=ToHTML(fldouvertureRail)%>  <%=ToHTML(fldidFT1)%>  <%=ToHTML(fldidFT2)%>  <%=ToHTML(fldnote)%> 
<% end if '------------------------------- ' relcliinstallconv Navigation begin '------------------------------- bEof = rs.eof if not(rs.EOF and iPage=1) then if iPage = 1 then %> Previous <% else %> Previous <% end if response.write " [ " & iPage & " ] " if bEof then %> Next <% else %> Next <% end if else %>
<% '------------------------------- ' relcliinstallconv Close Event start ' relcliinstallconv Close Event end '------------------------------- end sub '=============================== '=============================== ' Action of the Record Form '------------------------------- Sub relcliinstallconv1Action(sAction) '------------------------------- ' Initialize variables '------------------------------- Dim bExecSQL: bExecSQL = true Dim sActionFileName : sActionFileName = "" Dim sWhere : sWhere = "" Dim bErr : bErr = False Dim pPKid : pPKid = "" Dim fldidTypeConv : fldidTypeConv = "" Dim fldnumB2K : fldnumB2K = "" Dim fldidVoltage : fldidVoltage = "" Dim flddisjoncteurValeur : flddisjoncteurValeur = "" Dim flddisjoncteurNum : flddisjoncteurNum = "" Dim flddisjoncteurSituation : flddisjoncteurSituation = "" Dim flddymo : flddymo = "" Dim fldidTypeRuban : fldidTypeRuban = "" Dim fldouvertureRail : fldouvertureRail = "" Dim fldidFT1 : fldidFT1 = "" Dim fldidFT2 : fldidFT2 = "" Dim fldnote : fldnote = "" '------------------------------- '------------------------------- ' relcliinstallconv1 Action begin '------------------------------- sActionFileName = "convoyeurs.asp" '------------------------------- ' CANCEL action '------------------------------- if sAction = "cancel" then '------------------------------- ' relcliinstallconv1 BeforeCancel Event start ' relcliinstallconv1 BeforeCancel Event end '------------------------------- cn.Close Set cn = Nothing response.redirect sActionFileName end if '------------------------------- '------------------------------- ' Build WHERE statement '------------------------------- if sAction = "update" or sAction = "delete" then pPKid = GetParam("PK_id") if IsEmpty(pPKid) then exit sub sWhere = "id=" & ToSQL(pPKid, "Number") end if '------------------------------- '------------------------------- ' Load all form fields into variables '------------------------------- fldidTypeConv = GetParam("idTypeConv") fldnumB2K = GetParam("numB2K") fldidVoltage = GetParam("idVoltage") flddisjoncteurValeur = GetParam("disjoncteurValeur") flddisjoncteurNum = GetParam("disjoncteurNum") flddisjoncteurSituation = GetParam("disjoncteurSituation") flddymo = GetParam("dymo") fldidTypeRuban = GetParam("idTypeRuban") fldouvertureRail = GetParam("ouvertureRail") fldidFT1 = GetParam("idFT1") fldidFT2 = GetParam("idFT2") fldnote = GetParam("note") '------------------------------- ' Validate fields '------------------------------- if sAction = "insert" or sAction = "update" then if IsEmpty(fldidVoltage) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idVoltage is required.
" end if if IsEmpty(flddymo) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field dymo is required.
" end if if IsEmpty(fldidTypeRuban) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idTypeRuban is required.
" end if if IsEmpty(fldouvertureRail) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field ouvertureRail is required.
" end if if IsEmpty(fldidFT1) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idFT1 is required.
" end if if IsEmpty(fldidFT2) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idFT2 is required.
" end if if not isNumeric(fldidTypeConv) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idTypeConv is incorrect.
" end if if not isNumeric(fldidVoltage) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idVoltage is incorrect.
" end if if not isNumeric(flddymo) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field dymo is incorrect.
" end if if not isNumeric(fldidTypeRuban) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idTypeRuban is incorrect.
" end if if not isNumeric(fldouvertureRail) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field ouvertureRail is incorrect.
" end if if not isNumeric(fldidFT1) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idFT1 is incorrect.
" end if if not isNumeric(fldidFT2) then srelcliinstallconv1Err = srelcliinstallconv1Err & "The value in field idFT2 is incorrect.
" end if '------------------------------- ' relcliinstallconv1 Check Event start ' relcliinstallconv1 Check Event end '------------------------------- If len(srelcliinstallconv1Err) > 0 then exit sub end if end if '------------------------------- '------------------------------- ' Create SQL statement '------------------------------- select case sAction case "update" '------------------------------- ' relcliinstallconv1 Update Event start ' relcliinstallconv1 Update Event end '------------------------------- sSQL = "update relcliinstallconv set " & _ "idTypeConv=" & ToSQL(fldidTypeConv, "Number") & _ ",numB2K=" & ToSQL(fldnumB2K, "Text") & _ ",idVoltage=" & ToSQL(fldidVoltage, "Number") & _ ",disjoncteurValeur=" & ToSQL(flddisjoncteurValeur, "Text") & _ ",disjoncteurNum=" & ToSQL(flddisjoncteurNum, "Text") & _ ",disjoncteurSituation=" & ToSQL(flddisjoncteurSituation, "Text") & _ ",dymo=" & ToSQL(flddymo, "Number") & _ ",idTypeRuban=" & ToSQL(fldidTypeRuban, "Number") & _ ",ouvertureRail=" & ToSQL(fldouvertureRail, "Number") & _ ",idFT1=" & ToSQL(fldidFT1, "Number") & _ ",idFT2=" & ToSQL(fldidFT2, "Number") & _ ",note=" & ToSQL(fldnote, "Text") sSQL = sSQL & " where " & sWhere end select '------------------------------- '------------------------------- ' relcliinstallconv1 BeforeExecute Event start ' relcliinstallconv1 BeforeExecute Event end '------------------------------- '------------------------------- ' Execute SQL statement '------------------------------- if len(srelcliinstallconv1Err) > 0 then Exit Sub on error resume next if bExecSQL then cn.execute sSQL end if srelcliinstallconv1Err = ProcessError on error goto 0 if len(srelcliinstallconv1Err) > 0 then Exit Sub cn.Close Set cn = Nothing response.redirect sActionFileName '------------------------------- ' relcliinstallconv1 Action end '------------------------------- end sub '=============================== '=============================== ' Display Record Form '------------------------------- Sub relcliinstallconv1_Show() '------------------------------- ' relcliinstallconv1 Show begin '------------------------------- sWhere = "" Dim sFormTitle: sFormTitle = "Insert / Modify" bPK = true %> <% if not (srelcliinstallconv1Err = "") then %> <% end if %> <% '------------------------------- ' Load primary key and form parameters '------------------------------- if srelcliinstallconv1Err = "" then fldid = GetParam("id") pid = GetParam("id") else fldid = GetParam("id") fldidTypeConv = GetParam("idTypeConv") fldnumB2K = GetParam("numB2K") fldidVoltage = GetParam("idVoltage") flddisjoncteurValeur = GetParam("disjoncteurValeur") flddisjoncteurNum = GetParam("disjoncteurNum") flddisjoncteurSituation = GetParam("disjoncteurSituation") flddymo = GetParam("dymo") fldidTypeRuban = GetParam("idTypeRuban") fldouvertureRail = GetParam("ouvertureRail") fldidFT1 = GetParam("idFT1") fldidFT2 = GetParam("idFT2") fldnote = GetParam("note") pid = GetParam("PK_id") end if '------------------------------- ' Load all form fields '------------------------------- '------------------------------- ' Build WHERE statement if IsEmpty(pid) then bPK = False sWhere = sWhere & "id=" & ToSQL(pid, "Number") PK_id = pid '------------------------------- '------------------------------- ' relcliinstallconv1 Open Event start ' relcliinstallconv1 Open Event end '------------------------------- '------------------------------- ' Build SQL statement and open recordset '------------------------------- sSQL = "select * from relcliinstallconv where " & sWhere openrs rs, sSQL bIsUpdateMode = (bPK and not(sAction = "insert" and sForm = "relcliinstallconv1") and not rs.eof) '------------------------------- '------------------------------- ' Load all fields into variables from recordset or input parameters '------------------------------- if bIsUpdateMode then fldid = GetValue(rs, "id") fldidCli = GetValue(rs, "idCli") fldidInst = GetValue(rs, "idInst") '------------------------------- ' Load data from recordset when form displayed first time '------------------------------- if srelcliinstallconv1Err = "" then fldidTypeConv = GetValue(rs, "idTypeConv") fldnumB2K = GetValue(rs, "numB2K") fldidVoltage = GetValue(rs, "idVoltage") flddisjoncteurValeur = GetValue(rs, "disjoncteurValeur") flddisjoncteurNum = GetValue(rs, "disjoncteurNum") flddisjoncteurSituation = GetValue(rs, "disjoncteurSituation") flddymo = GetValue(rs, "dymo") fldidTypeRuban = GetValue(rs, "idTypeRuban") fldouvertureRail = GetValue(rs, "ouvertureRail") fldidFT1 = GetValue(rs, "idFT1") fldidFT2 = GetValue(rs, "idFT2") fldnote = GetValue(rs, "note") end if '------------------------------- ' relcliinstallconv1 ShowEdit Event start ' relcliinstallconv1 ShowEdit Event end '------------------------------- else if srelcliinstallconv1Err = "" then fldid = ToHTML(GetParam("id")) end if '------------------------------- ' relcliinstallconv1 ShowInsert Event start ' relcliinstallconv1 ShowInsert Event end '------------------------------- end if '------------------------------- ' Set lookup fields '------------------------------- fldidCli = DLookUp("eb_clients", "FriendName", "id=" & ToSQL(fldidCli, "Number")) fldidInst = DLookUp("relcliinstall", "Description", "id=" & ToSQL(fldidInst, "Number")) '------------------------------- ' relcliinstallconv1 Show Event start ' relcliinstallconv1 Show Event end '------------------------------- '------------------------------- ' Show form fields '------------------------------- %>
<%=sFormTitle%>
<%= srelcliinstallconv1Err %>
idCli <%=ToHTML(fldidCli)%> 
idInst <%=ToHTML(fldidInst)%> 
idTypeConv
numB2K
idVoltage
disjoncteurValeur
disjoncteurNum
disjoncteurSituation
dymo
idTypeRuban
ouvertureRail
idFT1
idFT2
note
<% if bIsUpdateMode then %> <% end if %>
<% '------------------------------- ' relcliinstallconv1 Close Event start ' relcliinstallconv1 Close Event end '------------------------------- Set rs = Nothing '------------------------------- ' relcliinstallconv1 Show end '------------------------------- End Sub '=============================== %>