<% ' ' Filename: ClientsGarantie.asp ' Generated with CodeCharge 2.0.5 ' ASP 2.0.ccp build 01/22/2002 ' '------------------------------- ' ClientsGarantie CustomIncludes begin %> <% ' ClientsGarantie CustomIncludes end '------------------------------- '=============================== ' Save Page and File Name available into variables '------------------------------- sFileName = "ClientsGarantie.asp" '=============================== '=============================== ' ClientsGarantie PageSecurity begin CheckSecurity(1) ' ClientsGarantie PageSecurity end '=============================== '=============================== ' ClientsGarantie Open Event start ' ClientsGarantie Open Event end '=============================== '=============================== ' ClientsGarantie OpenAnyPage Event start ' ClientsGarantie OpenAnyPage Event end '=============================== '=============================== ' Save the name of the form and type of action into the variables '------------------------------- sAction = GetParam("FormAction") sForm = GetParam("FormName") '=============================== ' ClientsGarantie Show begin '=============================== ' Page execution '------------------------------- 'Initialize error variables '------------------------------- seb_clients1Err = "" '------------------------------- ' Select the FormAction '------------------------------- Select Case sForm Case "eb_clients1" eb_clients1Action(sAction) end select '=============================== '=============================== ' HTML Page layout '------------------------------- %> EB Agenda - Statuts Garantie
<% EBMenu_Show %>
<% Search_Show %>
<% eb_clients_Show %> <% eb_clients1_Show %>
<% ' ClientsGarantie Show end ' ClientsGarantie Close Event start ' ClientsGarantie Close Event end '------------------------------- ' Destroy connection object '------------------------------- cn.close Set cn = nothing '=============================== '******************************************************************************** '=============================== ' Display Search Form '------------------------------- Sub Search_Show() Dim sFormTitle: sFormTitle = "Search" Dim action_page: action_page = "ClientsGarantie.asp" '------------------------------- ' Search Open Event start ' Search Open Event end '------------------------------- '------------------------------- ' Set variables with search parameters '------------------------------- flds_idGarantie = GetParam("s_idGarantie") '------------------------------- ' Search Show begin '------------------------------- '------------------------------- ' Search Show Event start ' Search Show Event end '------------------------------- %>
<%=sFormTitle%>
idGarantie <% openrs rss_idGarantie, "select idGarantie, StautGarantie from statutsgarantie order by 2" while not rss_idGarantie.EOF if cstr(GetValue(rss_idGarantie, 0)) = cstr(flds_idGarantie) then response.write " " & GetValue(rss_idGarantie, 1) & "
" else response.write " " & GetValue(rss_idGarantie, 1) & "
" end if rss_idGarantie.MoveNext wend set rss_idGarantie = nothing %>
<% '------------------------------- ' Search Show end '------------------------------- '------------------------------- ' Search Close Event start ' Search Close Event end '------------------------------- end sub '=============================== '=============================== ' Display Grid Form '------------------------------- Sub eb_clients_Show() '------------------------------- ' Initialize variables '------------------------------- Dim rs Dim sWhere : sWhere = "" Dim sOrder : sOrder = "" Dim sSQL : sSQL = "" Dim sFormTitle: sFormTitle = "eb_clients" Dim HasParam : HasParam = false Dim iSort : iSort = "" Dim iSorted : iSorted = "" Dim sDirection : sDirection = "" Dim form_sorting : form_sorting = "" Dim sSortParams : sSortParams = "" Dim iRecordsPerPage : iRecordsPerPage = 1000 Dim iCounter : iCounter = 0 Dim iPage : iPage = 0 Dim bEof : bEof = False Dim transit_params : transit_params = "s_idGarantie=" & ToURL(GetParam("s_idGarantie")) & "&" Dim form_params : form_params = "s_idGarantie=" & ToURL(GetParam("s_idGarantie")) & "&" '------------------------------- ' Build ORDER BY statement '------------------------------- sOrder = " order by e.FriendName Asc" iSort = GetParam("Formeb_clients_Sorting") iSorted = GetParam("Formeb_clients_Sorted") sDirection = "" if IsEmpty(iSort) then form_sorting = "" else if iSort = iSorted then form_sorting = "" sDirection = " DESC" sSortParams = "Formeb_clients_Sorting=" & iSort & "&Formeb_clients_Sorted=" & iSort & "&" else form_sorting = iSort sDirection = " ASC" sSortParams = "Formeb_clients_Sorting=" & iSort & "&Formeb_clients_Sorted=" & "&" end if if iSort = 1 then sOrder = " order by e.FriendName" & sDirection if iSort = 2 then sOrder = " order by s.StautGarantie" & sDirection end if '------------------------------- ' HTML column headers '------------------------------- %> <% '------------------------------- ' Build WHERE statement '------------------------------- ps_idGarantie = GetParam("s_idGarantie") if IsNumeric(ps_idGarantie) and not isEmpty(ps_idGarantie) then ps_idGarantie = ToSQL(ps_idGarantie, "Number") else ps_idGarantie = Empty if not isEmpty(ps_idGarantie) then HasParam = true sWhere = sWhere & "e.idGarantie=" & ps_idGarantie end if if HasParam then sWhere = " WHERE (" & sWhere & ")" end if '------------------------------- ' Build base SQL statement '------------------------------- sSQL = "select e.FriendName as e_FriendName, " & _ "e.id as e_id, " & _ "e.idGarantie as e_idGarantie, " & _ "s.idGarantie as s_idGarantie, " & _ "s.StautGarantie as s_StautGarantie " & _ " from (eb_clients e left join statutsgarantie s on s.idGarantie=e.idGarantie) " '------------------------------- '------------------------------- ' eb_clients Open Event start ' eb_clients 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 = 1000 iCounter = 0 '------------------------------- ' Process page scroller '------------------------------- iPage = GetParam("Formeb_clients_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 '------------------------------- fldFriendName_URLLink = "ClientsGarantie.asp" fldFriendName_id = GetValue(rs, "e_id") fldFriendName = GetValue(rs, "e_FriendName") fldid = GetValue(rs, "e_id") fldidGarantie = GetValue(rs, "s_StautGarantie") '------------------------------- ' eb_clients Show begin '------------------------------- '------------------------------- ' eb_clients Show Event start ' eb_clients Show Event end '------------------------------- '------------------------------- ' Process the HTML controls '------------------------------- %> <% '------------------------------- ' eb_clients 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 '------------------------------- ' eb_clients Navigation end '------------------------------- '------------------------------- ' Finish form processing '------------------------------- set rs = nothing %>
<%=sFormTitle%>
FriendName idGarantie
Aucuns enregistrements
<%=fldFriendName%>  <%=ToHTML(fldidGarantie)%> 
<% end if '------------------------------- ' eb_clients Navigation begin '------------------------------- bEof = rs.eof if not(rs.EOF and iPage=1) then if iPage = 1 then %> Précédent <% else %> Précédent <% end if response.write " [ " & iPage & " ] " if bEof then %> Ensuite <% else %> Ensuite <% end if else %>
<% '------------------------------- ' eb_clients Close Event start ' eb_clients Close Event end '------------------------------- end sub '=============================== '=============================== ' Action of the Record Form '------------------------------- Sub eb_clients1Action(sAction) '------------------------------- ' Initialize variables '------------------------------- Dim bExecSQL: bExecSQL = true Dim sActionFileName : sActionFileName = "" Dim sWhere : sWhere = "" Dim bErr : bErr = False Dim pPKid : pPKid = "" Dim fldidGarantie : fldidGarantie = "" '------------------------------- '------------------------------- ' eb_clients1 Action begin '------------------------------- sActionFileName = "ClientsGarantie.asp" '------------------------------- ' CANCEL action '------------------------------- if sAction = "cancel" then '------------------------------- ' eb_clients1 BeforeCancel Event start ' eb_clients1 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 '------------------------------- fldidGarantie = GetParam("idGarantie") '------------------------------- ' Validate fields '------------------------------- if sAction = "insert" or sAction = "update" then if IsEmpty(fldidGarantie) then seb_clients1Err = seb_clients1Err & "La valeur dans le domaine idGarantie est exigée.
" end if if not isNumeric(fldidGarantie) then seb_clients1Err = seb_clients1Err & "La valeur dans le domaine idGarantie est incorrecte.
" end if '------------------------------- ' eb_clients1 Check Event start ' eb_clients1 Check Event end '------------------------------- If len(seb_clients1Err) > 0 then exit sub end if end if '------------------------------- '------------------------------- ' Create SQL statement '------------------------------- select case sAction case "update" '------------------------------- ' eb_clients1 Update Event start ' eb_clients1 Update Event end '------------------------------- sSQL = "update eb_clients set " & _ "idGarantie=" & ToSQL(fldidGarantie, "Number") sSQL = sSQL & " where " & sWhere end select '------------------------------- '------------------------------- ' eb_clients1 BeforeExecute Event start ' eb_clients1 BeforeExecute Event end '------------------------------- '------------------------------- ' Execute SQL statement '------------------------------- if len(seb_clients1Err) > 0 then Exit Sub on error resume next if bExecSQL then cn.execute sSQL end if seb_clients1Err = ProcessError on error goto 0 if len(seb_clients1Err) > 0 then Exit Sub cn.Close Set cn = Nothing response.redirect sActionFileName '------------------------------- ' eb_clients1 Action end '------------------------------- end sub '=============================== '=============================== ' Display Record Form '------------------------------- Sub eb_clients1_Show() '------------------------------- ' eb_clients1 Show begin '------------------------------- sWhere = "" Dim sFormTitle: sFormTitle = "eb_clients" bPK = true %> <% if not (seb_clients1Err = "") then %> <% end if %> <% '------------------------------- ' Load primary key and form parameters '------------------------------- if seb_clients1Err = "" then fldid = GetParam("id") pid = GetParam("id") else fldid = GetParam("id") fldidGarantie = GetParam("idGarantie") 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 '------------------------------- '------------------------------- ' eb_clients1 Open Event start ' eb_clients1 Open Event end '------------------------------- '------------------------------- ' Build SQL statement and open recordset '------------------------------- sSQL = "select * from eb_clients where " & sWhere openrs rs, sSQL bIsUpdateMode = (bPK and not(sAction = "insert" and sForm = "eb_clients1") and not rs.eof) '------------------------------- '------------------------------- ' Load all fields into variables from recordset or input parameters '------------------------------- if bIsUpdateMode then fldid = GetValue(rs, "id") '------------------------------- ' Load data from recordset when form displayed first time '------------------------------- if seb_clients1Err = "" then fldidGarantie = GetValue(rs, "idGarantie") end if '------------------------------- ' eb_clients1 ShowEdit Event start ' eb_clients1 ShowEdit Event end '------------------------------- else if seb_clients1Err = "" then fldid = ToHTML(GetParam("id")) end if '------------------------------- ' eb_clients1 ShowInsert Event start ' eb_clients1 ShowInsert Event end '------------------------------- end if '------------------------------- ' eb_clients1 Show Event start ' eb_clients1 Show Event end '------------------------------- '------------------------------- ' Show form fields '------------------------------- %>
<%=sFormTitle%>
<%= seb_clients1Err %>
idGarantie
<% if bIsUpdateMode then %> <% end if %>
<% '------------------------------- ' eb_clients1 Close Event start ' eb_clients1 Close Event end '------------------------------- Set rs = Nothing '------------------------------- ' eb_clients1 Show end '------------------------------- End Sub '=============================== %>