<%@ CodePage=65001 %> <% 'Include Common Files @1-D8871EEC %> <% 'End Include Common Files 'Initialize Page @1-C252B99C ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim IsService Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBWwmWeb ' Page controls Dim Header2 Dim viewPropListbyRegIDSearch Dim viewPropListbyRegID Dim Footer Dim ChildControls Session.CodePage=28591 Response.ContentType = CCSContentType IsService = False Redirect = "" TemplateFileName = "Index.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "Index.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Authenticate User @1-C35EECDA CCSecurityRedirect Empty, "Login.asp" 'End Authenticate User 'Initialize Objects @1-A155B9B8 CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInitialize", Nothing) Set DBWwmWeb = New clsDBWwmWeb DBWwmWeb.Open Set Attributes = New clsAttributes Attributes("pathToRoot") = PathToRoot ' Controls Set Header2 = New clsHeader2 Set Header2.Attributes = Attributes Header2.Initialize "Header2", "" Set viewPropListbyRegIDSearch = new clsRecordviewPropListbyRegIDSearch Set viewPropListbyRegID = New clsGridviewPropListbyRegID Set Footer = New clsFooter Set Footer.Attributes = Attributes Footer.Initialize "Footer", "" viewPropListbyRegID.Initialize DBWwmWeb CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-E5C88B8A Header2.Operations viewPropListbyRegIDSearch.Operation Footer.Operations 'End Execute Components 'Go to destination page @1-6D35F4FD If NOT ( Redirect = "" ) Then UnloadPage Response.Redirect Redirect End If 'End Go to destination page 'Initialize HTML Template @1-2DA4DCFB CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate HTMLTemplate.Encoding = "iso-8859-1" Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-AA939452 Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Header2, viewPropListbyRegIDSearch, viewPropListbyRegID, Footer)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False If IsEmpty(MainHTML) Then MainHTML = HTMLTemplate.GetHTML("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing) If CCSEventResult Then Response.Write MainHTML 'End Show Page 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-BD71DF7E Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBWwmWeb.State = adStateOpen Then _ DBWwmWeb.Close Set DBWwmWeb = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Header2.UnloadPage Set Header2 = Nothing Set viewPropListbyRegIDSearch = Nothing Set viewPropListbyRegID = Nothing Footer.UnloadPage Set Footer = Nothing End Sub 'End UnloadPage Sub Class clsRecordviewPropListbyRegIDSearch 'viewPropListbyRegIDSearch Class @3-751EB455 'viewPropListbyRegIDSearch Variables @3-883C88D8 ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim s_PROP_ID Dim s_PROP_NAME Dim viewPropListbyRegIDPageSize Dim ClearParameters Dim Button_DoSearch 'End viewPropListbyRegIDSearch Variables 'viewPropListbyRegIDSearch Class_Initialize Event @3-774642DA Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes InsertAllowed = False UpdateAllowed = False DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "viewPropListbyRegIDSearch") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "viewPropListbyRegIDSearch" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set s_PROP_ID = CCCreateControl(ccsTextBox, "s_PROP_ID", Empty, ccsText, Empty, CCGetRequestParam("s_PROP_ID", Method)) Set s_PROP_NAME = CCCreateControl(ccsTextBox, "s_PROP_NAME", Empty, ccsText, Empty, CCGetRequestParam("s_PROP_NAME", Method)) Set viewPropListbyRegIDPageSize = CCCreateList(ccsListBox, "viewPropListbyRegIDPageSize", Empty, ccsText, CCGetRequestParam("viewPropListbyRegIDPageSize", Method), Empty) Set viewPropListbyRegIDPageSize.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("", "5", "10", "25", "100"), _ Array("Select Value", "5", "10", "25", "100"))) Set ClearParameters = CCCreateControl(ccsLink, "ClearParameters", Empty, ccsText, Empty, CCGetRequestParam("ClearParameters", Method)) Set Button_DoSearch = CCCreateButton("Button_DoSearch", Method) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(s_PROP_ID, s_PROP_NAME, viewPropListbyRegIDPageSize) End Sub 'End viewPropListbyRegIDSearch Class_Initialize Event 'viewPropListbyRegIDSearch Class_Terminate Event @3-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End viewPropListbyRegIDSearch Class_Terminate Event 'viewPropListbyRegIDSearch Validate Method @3-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End viewPropListbyRegIDSearch Validate Method 'viewPropListbyRegIDSearch Operation Method @3-353FAD83 Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = "Button_DoSearch" If Button_DoSearch.Pressed Then PressedButton = "Button_DoSearch" End If End If Redirect = "Index.asp" If Validate() Then If PressedButton = "Button_DoSearch" Then If NOT Button_DoSearch.OnClick() Then Redirect = "" Else Redirect = "Index.asp?" & CCGetQueryString("Form", Array(PressedButton, "ccsForm", "Button_DoSearch.x", "Button_DoSearch.y", "Button_DoSearch")) End If End If Else Redirect = "" End If End Sub 'End viewPropListbyRegIDSearch Operation Method 'viewPropListbyRegIDSearch Show Method @3-6D3EE5F7 Sub Show(Tpl) If NOT Visible Then Exit Sub EditMode = False HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "viewPropListbyRegIDSearch" & IIf(EditMode, ":Edit", "")) Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(s_PROP_ID, s_PROP_NAME, viewPropListbyRegIDPageSize, ClearParameters, Button_DoSearch)) ClearParameters.Parameters = CCGetQueryString("QueryString", Array("s_PROP_ID", "s_PROP_NAME", "viewPropListbyRegIDPageSize", "ccsForm")) ClearParameters.Page = "Index.asp" If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors s_PROP_ID.Errors Errors.AddErrors s_PROP_NAME.Errors Errors.AddErrors viewPropListbyRegIDPageSize.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "viewPropListbyRegIDSearch" & ":" Controls.Show End If End Sub 'End viewPropListbyRegIDSearch Show Method End Class 'End viewPropListbyRegIDSearch Class @3-A61BA892 Class clsGridviewPropListbyRegID 'viewPropListbyRegID Class @2-0761C808 'viewPropListbyRegID Variables @2-D6BA41BF ' Private variables Private VarPageSize ' Public variables Public ComponentName, CCSEvents Public Visible, Errors Public DataSource Public PageNumber Public Command Public TemplateBlock Public IsDSEmpty Public ForceIteration Public Attributes Private ShownRecords Public ActiveSorter, SortingDirection Public Recordset Private CCSEventResult ' Grid Controls Public StaticControls, RowControls, NoRecordsControls Dim Sorter_PROP_ID Dim Sorter_PROP_NAME Dim PROP_ID Dim PROP_NAME Dim Navigator 'End viewPropListbyRegID Variables 'viewPropListbyRegID Class_Initialize Event @2-B0FD6E8B Private Sub Class_Initialize() ComponentName = "viewPropListbyRegID" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set Errors = New clsErrors Set DataSource = New clsviewPropListbyRegIDDataSource Set Command = New clsCommand PageSize = CCGetParam(ComponentName & "PageSize", Empty) If IsNumeric(PageSize) And Len(PageSize) > 0 Then If PageSize <= 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageSizeError", Empty)) If PageSize > 100 Then PageSize = 100 End If If NOT IsNumeric(PageSize) OR IsEmpty(PageSize) Then _ PageSize = 10 _ Else _ PageSize = CInt(PageSize) PageNumber = CCGetParam(ComponentName & "Page", 1) If Not IsNumeric(PageNumber) And Len(PageNumber) > 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 ElseIf Len(PageNumber) > 0 Then If PageNumber > 0 Then PageNumber = CLng(PageNumber) Else Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty)) PageNumber = 1 End If Else PageNumber = 1 End If ActiveSorter = CCGetParam("viewPropListbyRegIDOrder", Empty) SortingDirection = CCGetParam("viewPropListbyRegIDDir", Empty) If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _ SortingDirection = Empty Set Sorter_PROP_ID = CCCreateSorter("Sorter_PROP_ID", Me, FileName) Set Sorter_PROP_NAME = CCCreateSorter("Sorter_PROP_NAME", Me, FileName) Set PROP_ID = CCCreateControl(ccsLink, "PROP_ID", Empty, ccsText, Empty, CCGetRequestParam("PROP_ID", ccsGet)) Set PROP_NAME = CCCreateControl(ccsLabel, "PROP_NAME", Empty, ccsText, Empty, CCGetRequestParam("PROP_NAME", ccsGet)) Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple) Navigator.PageSizes = Array("1", "5", "10", "25", "50") IsDSEmpty = True End Sub 'End viewPropListbyRegID Class_Initialize Event 'viewPropListbyRegID Initialize Method @2-2AEA3975 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection DataSource.PageSize = PageSize DataSource.SetOrder ActiveSorter, SortingDirection DataSource.AbsolutePage = PageNumber End Sub 'End viewPropListbyRegID Initialize Method 'viewPropListbyRegID Class_Terminate Event @2-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End viewPropListbyRegID Class_Terminate Event 'viewPropListbyRegID Show Method @2-0E0D4C3E Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock, NoRecordsBlock With DataSource .Parameters("sesUserID") = Session("UserID") .Parameters("urls_PROP_ID") = CCGetRequestParam("s_PROP_ID", ccsGET) .Parameters("urls_PROP_NAME") = CCGetRequestParam("s_PROP_NAME", ccsGET) End With CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) If DataSource.Errors.Count = 0 Then IsDSEmpty = Recordset.EOF Set TemplateBlock = Tpl.Block("Grid " & ComponentName) If TemplateBlock is Nothing Then Exit Sub Set RowBlock = TemplateBlock.Block("Row") Set NoRecordsBlock = TemplateBlock.Block("NoRecords") Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Sorter_PROP_ID, Sorter_PROP_NAME, Navigator)) Navigator.PageSize = PageSize Navigator.SetDataSource Recordset Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _ Array(PROP_ID, PROP_NAME)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub RowControls.PreserveControlsVisible Errors.AddErrors DataSource.Errors If Errors.Count > 0 Then TemplateBlock.HTML = CCFormatError("Grid " & ComponentName, Errors) Else ' Show NoRecords block if no records are found If Recordset.EOF Then Attributes.Show TemplateBlock, "viewPropListbyRegID:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If HasNext Then PROP_ID.Value = Recordset.Fields("PROP_ID") PROP_ID.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) PROP_ID.Parameters = CCAddParam(PROP_ID.Parameters, "PROP_ID", Recordset.Fields("PROP_ID_param1")) PROP_ID.Page = "LocationList.asp" PROP_NAME.Value = Recordset.Fields("PROP_NAME") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "viewPropListbyRegID:" RowControls.Show If HasNext Then Recordset.MoveNext ShownRecords = ShownRecords + 1 HasNext = HasNextRow() Loop Attributes.Show TemplateBlock, "viewPropListbyRegID:" StaticControls.Show End If End Sub 'End viewPropListbyRegID Show Method 'viewPropListbyRegID PageSize Property Let @2-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End viewPropListbyRegID PageSize Property Let 'viewPropListbyRegID PageSize Property Get @2-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End viewPropListbyRegID PageSize Property Get 'viewPropListbyRegID RowNumber Property Get @2-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End viewPropListbyRegID RowNumber Property Get 'viewPropListbyRegID HasNextRow Function @2-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End viewPropListbyRegID HasNextRow Function End Class 'End viewPropListbyRegID Class @2-A61BA892 Class clsviewPropListbyRegIDDataSource 'viewPropListbyRegIDDataSource Class @2-9BAF1350 'DataSource Variables @2-02327ECA Public Errors, Connection, Parameters, CCSEvents Public Recordset Public SQL, CountSQL, Order, Where, Orders, StaticOrder Public PageSize Public PageCount Public AbsolutePage Public Fields Dim WhereParameters Public AllParamsSet Public CmdExecution Public InsertOmitIfEmpty Public UpdateOmitIfEmpty Private CurrentOperation Private CCSEventResult ' Datasource fields Public PROP_ID Public PROP_ID_param1 Public PROP_NAME 'End DataSource Variables 'DataSource Class_Initialize Event @2-DEFD6B31 Private Sub Class_Initialize() Set CCSEvents = CreateObject("Scripting.Dictionary") Set Fields = New clsFields Set Recordset = New clsDataSource Set Recordset.DataSource = Me Set Errors = New clsErrors Set Connection = Nothing AllParamsSet = True Set PROP_ID = CCCreateField("PROP_ID", "PROP_ID", ccsText, Empty, Recordset) Set PROP_ID_param1 = CCCreateField("PROP_ID_param1", "PROP_ID", ccsText, Empty, Recordset) Set PROP_NAME = CCCreateField("PROP_NAME", "PROP_NAME", ccsText, Empty, Recordset) Fields.AddFields Array(PROP_ID, PROP_ID_param1, PROP_NAME) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing Orders = Array( _ Array("Sorter_PROP_ID", "PROP_ID", ""), _ Array("Sorter_PROP_NAME", "PROP_NAME", "")) SQL = "SELECT TOP {SqlParam_endRecord} * " & vbLf & _ "FROM viewPropListbyRegID {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM viewPropListbyRegID" Where = "" Order = "PROP_NAME" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'SetOrder Method @2-68FC9576 Sub SetOrder(Column, Direction) Order = Recordset.GetOrder(Order, Column, Direction, Orders) End Sub 'End SetOrder Method 'BuildTableWhere Method @2-D8FD6C8A Public Sub BuildTableWhere() Dim WhereParams If Not WhereParameters Is Nothing Then _ Exit Sub Set WhereParameters = new clsSQLParameters With WhereParameters Set .Connection = Connection Set .ParameterSources = Parameters Set .DataSource = Me .AddParameter 1, "sesUserID", ccsInteger, Empty, Empty, Empty, False .AddParameter 2, "urls_PROP_ID", ccsText, Empty, Empty, Empty, False .AddParameter 3, "urls_PROP_NAME", ccsText, Empty, Empty, Empty, False .Criterion(1) = .Operation(opEqual, False, "REGID", .getParamByID(1)) .Criterion(2) = .Operation(opContains, False, "PROP_ID", .getParamByID(2)) .Criterion(3) = .Operation(opContains, False, "PROP_NAME", .getParamByID(3)) .AssembledWhere = .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)) WhereParams = .AssembledWhere If Len(Where) > 0 Then If Len(WhereParams) > 0 Then _ Where = Where & " AND " & WhereParams Else If Len(WhereParams) > 0 Then _ Where = WhereParams End If End With End Sub 'End BuildTableWhere Method 'Open Method @2-40984FC5 Function Open(Cmd) Errors.Clear If Connection Is Nothing Then Set Open = New clsEmptyDataSource Exit Function End If Set Cmd.Connection = Connection Cmd.CommandOperation = cmdOpen Cmd.PageSize = PageSize Cmd.ActivePage = AbsolutePage Cmd.CommandType = dsTable CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me) Cmd.SQL = SQL Cmd.CountSQL = CountSQL BuildTableWhere Cmd.Where = Where Cmd.OrderBy = Order If(Len(StaticOrder)>0) Then If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy Cmd.OrderBy = StaticOrder + Cmd.OrderBy End If Cmd.Options("TOP") = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me) If Errors.Count = 0 And CCSEventResult Then _ Set Recordset = Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me) Set Recordset.FieldsCollection = Fields Set Open = Recordset End Function 'End Open Method 'DataSource Class_Terminate Event @2-41B4B08D Private Sub Class_Terminate() If Recordset.State = adStateOpen Then _ Recordset.Close Set Recordset = Nothing Set Parameters = Nothing Set Errors = Nothing End Sub 'End DataSource Class_Terminate Event End Class 'End viewPropListbyRegIDDataSource Class @2-A61BA892 'Include Page Implementation @19-470FDEDE %> <% 'End Include Page Implementation 'Include Page Implementation @20-328EC137 %> <% 'End Include Page Implementation %>