<% Const EW_PAGE_ID = "list" Const EW_TABLE_NAME = "CounterLocations" %> <% Session.Timeout = 20 %> <% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% ' Open connection to the database Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open EW_DB_CONNECTION_STRING %> <% ' Common page loading event (in userfn60.asp) Call Page_Loading() %> <% ' Page load event, used in current page Call Page_Load() %> <% CounterLocations.Export = Request.QueryString("export") ' Get export parameter sExport = CounterLocations.Export ' Get export parameter, used in header sExportFile = CounterLocations.TableVar ' Get export file, used in header If CounterLocations.Export = "html" Then ' Printer friendly, no action required End If %> <% ' Paging variables Dim Pager, PagerItem ' Pager Dim nDisplayRecs ' Number of display records Dim nRecRange ' Record display range Dim nStartRec, nStopRec, nTotalRecs nStartRec = 0 ' Start record index nStopRec = 0 ' Stop record index nTotalRecs = 0 ' Total number of records nDisplayRecs = 5000 nRecRange = 10 Dim i Dim nRecCount nRecCount = 0 ' Record count Dim RowCnt, RowIndex, OptionCnt ' Sort Dim sSortOrder ' Search filters Dim sSrchAdvanced, sSrchBasic, sSrchWhere, sFilter sSrchAdvanced = "" ' Advanced search filter sSrchBasic = "" ' Basic search filter sSrchWhere = "" ' Search where clause sFilter = "" Dim bEditRow, nEditRowCnt ' Edit row ' Master/Detail Dim sDbMasterFilter, sDbDetailFilter sDbMasterFilter = "" ' Master filter sDbDetailFilter = "" ' Detail filter Dim sSqlMaster sSqlMaster = "" ' Sql for master record ' Handle reset command ResetCmd() ' Get search criteria for advanced search sSrchAdvanced = AdvancedSearchWhere() ' Build search criteria If sSrchAdvanced <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchAdvanced & ")" End If If sSrchBasic <> "" Then If sSrchWhere <> "" Then sSrchWhere = sSrchWhere & " AND " sSrchWhere = sSrchWhere & "(" & sSrchBasic & ")" End If ' Save search criteria If sSrchWhere <> "" Then If sSrchAdvanced = "" Then Call ResetAdvancedSearchParms() CounterLocations.SearchWhere = sSrchWhere ' Save to Session nStartRec = 1 ' Reset start record counter CounterLocations.StartRecordNumber = nStartRec Else Call RestoreSearchParms() End If ' Build filter sFilter = "" If sDbDetailFilter <> "" Then If sFilter <> "" Then sFilter = sFilter & " AND " sFilter = sFilter & "(" & sDbDetailFilter & ")" End If If sSrchWhere <> "" Then If sFilter <> "" Then sFilter = sFilter & " AND " sFilter = sFilter & "(" & sSrchWhere & ")" End If ' Set up filter in Session CounterLocations.SessionWhere = sFilter CounterLocations.CurrentFilter = "" ' Set Up Sorting Order SetUpSortOrder() ' Set Return Url CounterLocations.ReturnUrl = "CounterLocationslist.asp" %> <% If CounterLocations.Export = "" Then %> <% End If %> <% If CounterLocations.Export = "" Then %> <% End If %> <% ' Load recordset Dim rs Set rs = LoadRecordset() nTotalRecs = rs.RecordCount nStartRec = 1 If nDisplayRecs <= 0 Then ' Display all records nDisplayRecs = nTotalRecs End If If Not (EW_EXPORT_ALL And CounterLocations.Export <> "") Then SetUpStartRec() ' Set up start record position End If %>

TABLE: Counter Locations <% If CounterLocations.Export = "" Then %>   Printer Friendly <% End If %>

<% If CounterLocations.Export = "" Then %>
<% Call LoadAdvancedSearch() ' Load advanced search ' Render for search CounterLocations.RowType = EW_ROWTYPE_SEARCH Call RenderRow() %>
Year contains
>
Make contains
>
Model contains
> "OR" Then Response.Write " checked" %>>and >or contains >
New contains
>
    Show all 
<% End If %> <% If Session(EW_SESSION_MESSAGE) <> "" Then %>

<%= Session(EW_SESSION_MESSAGE) %>

<% Session(EW_SESSION_MESSAGE) = "" ' Clear message End If %>
<% If CounterLocations.Export = "" Then %>
<% End If %> <% If nTotalRecs > 0 Then %> <% OptionCnt = 0 %> <% If CounterLocations.Export = "" Then %> <% End If %> <% If (EW_EXPORT_ALL And CounterLocations.Export <> "") Then nStopRec = nTotalRecs Else nStopRec = nStartRec + nDisplayRecs - 1 ' Set the last record to display End If ' Move to first record directly for performance reason nRecCount = nStartRec - 1 If Not rs.Eof Then rs.MoveFirst rs.Move nStartRec - 1 End If RowCnt = 0 Do While (Not rs.Eof) And (nRecCount < nStopRec) nRecCount = nRecCount + 1 If CLng(nRecCount) >= CLng(nStartRec) Then RowCnt = RowCnt + 1 ' Init row class and style CounterLocations.CssClass = "ewTableRow" CounterLocations.CssStyle = "" ' Init row event CounterLocations.RowClientEvents = "onmouseover='ew_MouseOver(this);' onmouseout='ew_MouseOut(this);' onclick='ew_Click(this);'" Call LoadRowValues(rs) ' Load row values CounterLocations.RowType = EW_ROWTYPE_VIEW ' Render view Call RenderRow() %> > > ><%= CounterLocations.Stock_Ticket.ViewValue %> > ><%= CounterLocations.Row.ViewValue %> > ><%= CounterLocations.Vin.ViewValue %> > ><%= CounterLocations.zYear.ViewValue %> > ><%= CounterLocations.Make.ViewValue %> > ><%= CounterLocations.Model.ViewValue %> > ><%= CounterLocations.zNew.ViewValue %> <% If CounterLocations.Export = "" Then %> <% End If %> <% End If rs.MoveNext Loop %>
<% If CounterLocations.Export <> "" Then %> Stock Ticket <% Else %> &ordertype=<%= CounterLocations.Stock_Ticket.ReverseSort %>">Stock Ticket<% If CounterLocations.Stock_Ticket.Sort = "ASC" Then %><% ElseIf CounterLocations.Stock_Ticket.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> Row <% Else %> &ordertype=<%= CounterLocations.Row.ReverseSort %>">Row<% If CounterLocations.Row.Sort = "ASC" Then %><% ElseIf CounterLocations.Row.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> Vin <% Else %> &ordertype=<%= CounterLocations.Vin.ReverseSort %>">Vin<% If CounterLocations.Vin.Sort = "ASC" Then %><% ElseIf CounterLocations.Vin.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> Year <% Else %> &ordertype=<%= CounterLocations.zYear.ReverseSort %>">Year<% If CounterLocations.zYear.Sort = "ASC" Then %><% ElseIf CounterLocations.zYear.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> Make <% Else %> &ordertype=<%= CounterLocations.Make.ReverseSort %>">Make<% If CounterLocations.Make.Sort = "ASC" Then %><% ElseIf CounterLocations.Make.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> Model <% Else %> &ordertype=<%= CounterLocations.Model.ReverseSort %>">Model<% If CounterLocations.Model.Sort = "ASC" Then %><% ElseIf CounterLocations.Model.Sort = "DESC" Then %><% End If %> <% End If %> <% If CounterLocations.Export <> "" Then %> New <% Else %> &ordertype=<%= CounterLocations.zNew.ReverseSort %>">New<% If CounterLocations.zNew.Sort = "ASC" Then %><% ElseIf CounterLocations.zNew.Sort = "DESC" Then %><% End If %> <% End If %>
<% If CounterLocations.Export = "" Then %>
<% End If %> <% End If %>
<% ' Close recordset and connection rs.Close Set rs = Nothing %> <% If CounterLocations.Export = "" Then %>
<% If Not IsObject(Pager) Then Set Pager = ew_NewNumericPager(nStartRec, nDisplayRecs, nTotalRecs, nRecRange) %> <% If Pager.RecordCount > 0 Then %> <% If Pager.FirstButton.Enabled Then %> First  <% End If %> <% If Pager.PrevButton.Enabled Then %> Previous  <% End If %> <% For Each PagerItem In Pager.Items %> <% If PagerItem.Enabled Then %><% End If %><%= PagerItem.Text %><% If PagerItem.Enabled Then %><% End If %>  <% Next %> <% If Pager.NextButton.Enabled Then %> Next  <% End If %> <% If Pager.LastButton.Enabled Then %> Last  <% End If %> <% If Pager.ButtonCount > 0 Then %>
<% End If %> Records <%= Pager.FromIndex %> to <%= Pager.ToIndex %> of <%= Pager.RecordCount %> <% Else %> <% If sSrchWhere = "0=101" Then %> Please enter search criteria <% Else %> No records found <% End If %> <% End If %>
<% End If %> <% If CounterLocations.Export = "" Then %> <% End If %> <% If CounterLocations.Export = "" Then %> <% End If %> <% ' If control is passed here, simply terminate the page without redirect Call Page_Terminate("") ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url, otherwise end response ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() conn.Close ' Close Connection Set conn = Nothing Set CounterLocations = Nothing ' Go to url if specified If url <> "" Then Response.Clear Response.Redirect url End If ' Terminate response Response.End End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- %> <% ' Return Advanced Search Where based on QueryString parameters Function AdvancedSearchWhere() Dim sWhere sWhere = "" ' Field Year Call BuildSearchSql(sWhere, CounterLocations.zYear, Request.QueryString("x_zYear"), Request.QueryString("z_zYear"), Request.QueryString("v_zYear"), Request.QueryString("y_zYear"), Request.QueryString("w_zYear")) ' Field Make Call BuildSearchSql(sWhere, CounterLocations.Make, Request.QueryString("x_Make"), Request.QueryString("z_Make"), Request.QueryString("v_Make"), Request.QueryString("y_Make"), Request.QueryString("w_Make")) ' Field Model Call BuildSearchSql(sWhere, CounterLocations.Model, Request.QueryString("x_Model"), Request.QueryString("z_Model"), Request.QueryString("v_Model"), Request.QueryString("y_Model"), Request.QueryString("w_Model")) ' Field New Call BuildSearchSql(sWhere, CounterLocations.zNew, Request.QueryString("x_zNew"), Request.QueryString("z_zNew"), Request.QueryString("v_zNew"), Request.QueryString("y_zNew"), Request.QueryString("w_zNew")) AdvancedSearchWhere = sWhere ' Set up search parm If AdvancedSearchWhere <> "" Then ' Field Year Call SetSearchParm(CounterLocations.zYear, Request.QueryString("x_zYear"), Request.QueryString("z_zYear"), Request.QueryString("v_zYear"), Request.QueryString("y_zYear"), Request.QueryString("w_zYear")) ' Field Make Call SetSearchParm(CounterLocations.Make, Request.QueryString("x_Make"), Request.QueryString("z_Make"), Request.QueryString("v_Make"), Request.QueryString("y_Make"), Request.QueryString("w_Make")) ' Field Model Call SetSearchParm(CounterLocations.Model, Request.QueryString("x_Model"), Request.QueryString("z_Model"), Request.QueryString("v_Model"), Request.QueryString("y_Model"), Request.QueryString("w_Model")) ' Field New Call SetSearchParm(CounterLocations.zNew, Request.QueryString("x_zNew"), Request.QueryString("z_zNew"), Request.QueryString("v_zNew"), Request.QueryString("y_zNew"), Request.QueryString("w_zNew")) End If End Function ' Build search sql Sub BuildSearchSql(Where, Fld, FldVal, FldOpr, FldCond, FldVal2, FldOpr2) Dim FldParm Dim IsValidValue, sWrk sWrk = "" FldParm = Mid(Fld.FldVar, 3) FldOpr = UCase(Trim(FldOpr)) If (FldOpr = "") Then FldOpr = "=" FldOpr2 = UCase(Trim(FldOpr2)) If FldOpr2 = "" Then FldOpr2 = "=" If Fld.FldDataType = EW_DATATYPE_BOOLEAN Then If FldVal <> "" Then FldVal = ew_IIf(FldVal="1", "True", "False") If FldVal2 <> "" Then FldVal2 = ew_IIf(FldVal2="1", "True", "False") ElseIf Fld.FldDataType = EW_DATATYPE_DATE Then If FldVal <> "" Then FldVal = ew_UnFormatDateTime(FldVal, Fld.FldDateTimeFormat) If FldVal2 <> "" Then FldVal2 = ew_UnFormatDateTime(FldVal2, Fld.FldDateTimeFormat) End If If FldOpr = "BETWEEN" Then IsValidValue = (Fld.FldDataType <> EW_DATATYPE_NUMBER) Or _ (Fld.FldDataType = EW_DATATYPE_NUMBER And IsNumeric(FldVal) And IsNumeric(FldVal2)) If FldVal <> "" And FldVal2 <> "" And IsValidValue Then sWrk = Fld.FldExpression & " BETWEEN " & ew_QuotedValue(FldVal, Fld.FldDataType) & _ " AND " & ew_QuotedValue(FldVal2, Fld.FldDataType) End If ElseIf FldOpr = "IS NULL" Or FldOpr = "IS NOT NULL" Then sWrk = Fld.FldExpression & " " & FldOpr Else IsValidValue = (Fld.FldDataType <> EW_DATATYPE_NUMBER) Or _ (Fld.FldDataType = EW_DATATYPE_NUMBER And IsNumeric(FldVal)) If FldVal <> "" And IsValidValue And ew_IsValidOpr(FldOpr, Fld.FldDataType) Then sWrk = Fld.FldExpression & SearchString(FldOpr, FldVal, Fld.FldDataType) End If IsValidValue = (Fld.FldDataType <> EW_DATATYPE_NUMBER) Or _ (Fld.FldDataType = EW_DATATYPE_NUMBER And IsNumeric(FldVal2)) If FldVal2 <> "" And IsValidValue And ew_IsValidOpr(FldOpr2, Fld.FldDataType) Then If sWrk <> "" Then sWrk = sWrk & " " & ew_IIf(FldCond="OR", "OR", "AND") & " " End If sWrk = sWrk & Fld.FldExpression & SearchString(FldOpr2, FldVal2, Fld.FldDataType) End If End If If sWrk <> "" Then If Where <> "" Then Where = Where & " AND " Where = Where & "(" & sWrk & ")" End If End Sub ' Return search string Function SearchString(FldOpr, FldVal, FldType) If FldOpr = "LIKE" Or FldOpr = "NOT LIKE" Then SearchString = " " & FldOpr & " " & ew_QuotedValue("%" & FldVal & "%", FldType) ElseIf FldOpr = "STARTS WITH" Then SearchString = " LIKE " & ew_QuotedValue("%" & FldVal, FldType) Else SearchString = " " & FldOpr & " " & ew_QuotedValue(FldVal, FldType) End If End Function ' Set search parm Sub SetSearchParm(Fld, FldVal, FldOpr, FldCond, FldVal2, FldOpr2) Dim FldParm FldParm = Mid(Fld.FldVar, 3) Call CounterLocations.SetAdvancedSearch("x_" & FldParm, FldVal) Call CounterLocations.SetAdvancedSearch("z_" & FldParm, FldOpr) Call CounterLocations.SetAdvancedSearch("v_" & FldParm, FldCond) Call CounterLocations.SetAdvancedSearch("y_" & FldParm, FldVal2) Call CounterLocations.SetAdvancedSearch("w_" & FldParm, FldOpr2) End Sub ' Clear all search parameters Sub ResetSearchParms() ' Clear search where sSrchWhere = "" CounterLocations.SearchWhere = sSrchWhere ' Clear advanced search parameters Call ResetAdvancedSearchParms() End Sub ' Clear all advanced search parameters Sub ResetAdvancedSearchParms() ' Clear advanced search parameters Call CounterLocations.SetAdvancedSearch("x_zYear", "") Call CounterLocations.SetAdvancedSearch("x_Make", "") Call CounterLocations.SetAdvancedSearch("x_Model", "") Call CounterLocations.SetAdvancedSearch("v_Model", "AND") Call CounterLocations.SetAdvancedSearch("y_Model", "") Call CounterLocations.SetAdvancedSearch("x_zNew", "") End Sub ' Restore all search parameters Sub RestoreSearchParms() sSrchWhere = CounterLocations.SearchWhere ' Restore advanced search settings Call RestoreAdvancedSearchParms() End Sub ' Restore all advanced search parameters Sub RestoreAdvancedSearchParms() ' Restore advanced search parms CounterLocations.zYear.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_zYear") CounterLocations.Make.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_Make") CounterLocations.Model.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_Model") CounterLocations.Model.AdvancedSearch.SearchCondition = CounterLocations.GetAdvancedSearch("v_Model") CounterLocations.Model.AdvancedSearch.SearchValue2 = CounterLocations.GetAdvancedSearch("y_Model") CounterLocations.zNew.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_zNew") End Sub ' Set up Sort parameters based on Sort Links clicked Sub SetUpSortOrder() Dim sOrderBy Dim sSortField, sLastSort, sThisSort Dim bCtrl ' Check for an Order parameter If Request.QueryString("order").Count > 0 Then CounterLocations.CurrentOrder = Request.QueryString("order") CounterLocations.CurrentOrderType = Request.QueryString("ordertype") ' Field Stock Ticket Call CounterLocations.UpdateSort(CounterLocations.Stock_Ticket) ' Field Row Call CounterLocations.UpdateSort(CounterLocations.Row) ' Field Vin Call CounterLocations.UpdateSort(CounterLocations.Vin) ' Field Year Call CounterLocations.UpdateSort(CounterLocations.zYear) ' Field Make Call CounterLocations.UpdateSort(CounterLocations.Make) ' Field Model Call CounterLocations.UpdateSort(CounterLocations.Model) ' Field New Call CounterLocations.UpdateSort(CounterLocations.zNew) CounterLocations.StartRecordNumber = 1 ' Reset start position End If sOrderBy = CounterLocations.SessionOrderBy ' Get order by from Session If sOrderBy = "" Then If CounterLocations.SqlOrderBy <> "" Then sOrderBy = CounterLocations.SqlOrderBy CounterLocations.SessionOrderBy = sOrderBy End If End If End Sub ' Reset command based on querystring parameter cmd= ' - RESET: reset search parameters ' - RESETALL: reset search & master/detail parameters ' - RESETSORT: reset sort parameters Sub ResetCmd() Dim sCmd ' Get reset cmd If Request.QueryString("cmd").Count > 0 Then sCmd = Request.QueryString("cmd") ' Reset search criteria If LCase(sCmd) = "reset" Or LCase(sCmd) = "resetall" Then Call ResetSearchParms() End If ' Reset Sort Criteria If LCase(sCmd) = "resetsort" Then Dim sOrderBy sOrderBy = "" CounterLocations.SessionOrderBy = sOrderBy CounterLocations.Stock_Ticket.Sort = "" CounterLocations.Row.Sort = "" CounterLocations.Vin.Sort = "" CounterLocations.zYear.Sort = "" CounterLocations.Make.Sort = "" CounterLocations.Model.Sort = "" CounterLocations.zNew.Sort = "" End If ' Reset start position nStartRec = 1 CounterLocations.StartRecordNumber = nStartRec End If End Sub %> <% ' Set up Starting Record parameters based on Pager Navigation Sub SetUpStartRec() Dim nPageNo ' Exit if nDisplayRecs = 0 If nDisplayRecs = 0 Then Exit Sub ' Check for a START parameter If Request.QueryString(EW_TABLE_START_REC).Count > 0 Then nStartRec = Request.QueryString(EW_TABLE_START_REC) CounterLocations.StartRecordNumber = nStartRec ElseIf Request.QueryString(EW_TABLE_PAGE_NO).Count > 0 Then nPageNo = Request.QueryString(EW_TABLE_PAGE_NO) If IsNumeric(nPageNo) Then nStartRec = (nPageNo-1)*nDisplayRecs+1 If nStartRec <= 0 Then nStartRec = 1 ElseIf nStartRec >= ((nTotalRecs-1)\nDisplayRecs)*nDisplayRecs+1 Then nStartRec = ((nTotalRecs-1)\nDisplayRecs)*nDisplayRecs+1 End If CounterLocations.StartRecordNumber = nStartRec Else nStartRec = CounterLocations.StartRecordNumber End If Else nStartRec = CounterLocations.StartRecordNumber End If ' Check if correct start record counter If Not IsNumeric(nStartRec) Or nStartRec = "" Then ' Avoid invalid start record counter nStartRec = 1 ' Reset start record counter CounterLocations.StartRecordNumber = nStartRec ElseIf CLng(nStartRec) > CLng(nTotalRecs) Then ' Avoid starting record > total records nStartRec = ((nTotalRecs-1)\nDisplayRecs)*nDisplayRecs+1 ' Point to last page first record CounterLocations.StartRecordNumber = nStartRec ElseIf (nStartRec-1) Mod nDisplayRecs <> 0 Then nStartRec = ((nStartRec-1)\nDisplayRecs)*nDisplayRecs+1 ' Point to page boundary CounterLocations.StartRecordNumber = nStartRec End If End Sub %> <% ' Load recordset Function LoadRecordset() ' Call Recordset Selecting event Call CounterLocations.Recordset_Selecting(CounterLocations.CurrentFilter) ' Load list page sql Dim sSql sSql = CounterLocations.ListSQL ' Response.Write sSql ' Uncomment to show SQL for debugging ' Load recordset Dim rs Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = EW_CURSORLOCATION rs.Open sSql, conn, 1, 2 ' Call Recordset Selected event Call CounterLocations.Recordset_Selected(rs) Set LoadRecordset = rs End Function %> <% ' Load row based on key values Function LoadRow() Dim rs, sSql, sFilter sFilter = CounterLocations.SqlKeyFilter ' Call Row Selecting event Call CounterLocations.Row_Selecting(sFilter) ' Load sql based on filter CounterLocations.CurrentFilter = sFilter sSql = CounterLocations.SQL Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadRow = False Else LoadRow = True rs.MoveFirst Call LoadRowValues(rs) ' Load row values ' Call Row Selected event Call CounterLocations.Row_Selected(rs) End If rs.Close Set rs = Nothing End Function ' Load row values from recordset Sub LoadRowValues(rs) CounterLocations.Stock_Ticket.DbValue = rs("Stock Ticket") CounterLocations.Row.DbValue = rs("Row") CounterLocations.Vin.DbValue = rs("Vin") CounterLocations.zYear.DbValue = rs("Year") CounterLocations.Make.DbValue = rs("Make") CounterLocations.Model.DbValue = rs("Model") CounterLocations.zNew.DbValue = rs("New") End Sub %> <% ' Render row values based on field settings Sub RenderRow() ' Call Row Rendering event Call CounterLocations.Row_Rendering() ' Common render codes for all row types ' Stock Ticket CounterLocations.Stock_Ticket.CellCssStyle = "" CounterLocations.Stock_Ticket.CellCssClass = "" ' Row CounterLocations.Row.CellCssStyle = "" CounterLocations.Row.CellCssClass = "" ' Vin CounterLocations.Vin.CellCssStyle = "" CounterLocations.Vin.CellCssClass = "" ' Year CounterLocations.zYear.CellCssStyle = "" CounterLocations.zYear.CellCssClass = "" ' Make CounterLocations.Make.CellCssStyle = "" CounterLocations.Make.CellCssClass = "" ' Model CounterLocations.Model.CellCssStyle = "" CounterLocations.Model.CellCssClass = "" ' New CounterLocations.zNew.CellCssStyle = "" CounterLocations.zNew.CellCssClass = "" If CounterLocations.RowType = EW_ROWTYPE_VIEW Then ' View row ' Stock Ticket CounterLocations.Stock_Ticket.ViewValue = CounterLocations.Stock_Ticket.CurrentValue CounterLocations.Stock_Ticket.CssStyle = "" CounterLocations.Stock_Ticket.CssClass = "" CounterLocations.Stock_Ticket.ViewCustomAttributes = "" ' Row CounterLocations.Row.ViewValue = CounterLocations.Row.CurrentValue CounterLocations.Row.CssStyle = "" CounterLocations.Row.CssClass = "" CounterLocations.Row.ViewCustomAttributes = "" ' Vin CounterLocations.Vin.ViewValue = CounterLocations.Vin.CurrentValue CounterLocations.Vin.CssStyle = "" CounterLocations.Vin.CssClass = "" CounterLocations.Vin.ViewCustomAttributes = "" ' Year CounterLocations.zYear.ViewValue = CounterLocations.zYear.CurrentValue CounterLocations.zYear.CssStyle = "" CounterLocations.zYear.CssClass = "" CounterLocations.zYear.ViewCustomAttributes = "" ' Make CounterLocations.Make.ViewValue = CounterLocations.Make.CurrentValue CounterLocations.Make.CssStyle = "" CounterLocations.Make.CssClass = "" CounterLocations.Make.ViewCustomAttributes = "" ' Model CounterLocations.Model.ViewValue = CounterLocations.Model.CurrentValue CounterLocations.Model.CssStyle = "" CounterLocations.Model.CssClass = "" CounterLocations.Model.ViewCustomAttributes = "" ' New CounterLocations.zNew.ViewValue = CounterLocations.zNew.CurrentValue CounterLocations.zNew.CssStyle = "" CounterLocations.zNew.CssClass = "" CounterLocations.zNew.ViewCustomAttributes = "" ' Stock Ticket CounterLocations.Stock_Ticket.HrefValue = "" ' Row CounterLocations.Row.HrefValue = "" ' Vin CounterLocations.Vin.HrefValue = "" ' Year CounterLocations.zYear.HrefValue = "" ' Make CounterLocations.Make.HrefValue = "" ' Model CounterLocations.Model.HrefValue = "" ' New CounterLocations.zNew.HrefValue = "" ElseIf CounterLocations.RowType = EW_ROWTYPE_ADD Then ' Add row ElseIf CounterLocations.RowType = EW_ROWTYPE_EDIT Then ' Edit row ElseIf CounterLocations.RowType = EW_ROWTYPE_SEARCH Then ' Search row ' Year CounterLocations.zYear.EditCustomAttributes = "" CounterLocations.zYear.EditValue = ew_HtmlEncode(CounterLocations.zYear.AdvancedSearch.SearchValue) ' Make CounterLocations.Make.EditCustomAttributes = "" CounterLocations.Make.EditValue = ew_HtmlEncode(CounterLocations.Make.AdvancedSearch.SearchValue) ' Model CounterLocations.Model.EditCustomAttributes = "" CounterLocations.Model.EditValue = ew_HtmlEncode(CounterLocations.Model.AdvancedSearch.SearchValue) CounterLocations.Model.EditCustomAttributes = "" CounterLocations.Model.EditValue2 = ew_HtmlEncode(CounterLocations.Model.AdvancedSearch.SearchValue2) ' New CounterLocations.zNew.EditCustomAttributes = "" CounterLocations.zNew.EditValue = ew_HtmlEncode(CounterLocations.zNew.AdvancedSearch.SearchValue) End If ' Call Row Rendered event Call CounterLocations.Row_Rendered() End Sub %> <% ' Load advanced search Function LoadAdvancedSearch() CounterLocations.zYear.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_zYear") CounterLocations.Make.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_Make") CounterLocations.Model.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_Model") CounterLocations.Model.AdvancedSearch.SearchCondition = CounterLocations.GetAdvancedSearch("v_Model") CounterLocations.Model.AdvancedSearch.SearchValue2 = CounterLocations.GetAdvancedSearch("y_Model") CounterLocations.zNew.AdvancedSearch.SearchValue = CounterLocations.GetAdvancedSearch("x_zNew") End Function %> <% ' Page Load event Sub Page_Load() '***Response.Write "Page Load" End Sub ' Page Unload event Sub Page_Unload() '***Response.Write "Page Unload" End Sub %>