<%@ CodePage=1252 %> <% 'Include Common Files @1-07AFC038 %> <% 'End Include Common Files 'Initialize Page @1-0B977011 ' 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 DBInternet ' Page controls Dim Header Dim articles_event_categoriesSearch Dim articles_event_categories Dim Label1 Dim articles Dim Footer Dim ChildControls Response.ContentType = CCSContentType IsService = False Redirect = "" TemplateFileName = "Article.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "Article.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-A02DF72F BindEvents "Page" CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInitialize", Nothing) Set DBInternet = New clsDBInternet DBInternet.Open Set Attributes = New clsAttributes Attributes("pathToRoot") = PathToRoot ' Controls Set Header = New clsHeader Set Header.Attributes = Attributes Header.Initialize "Header", "" Set articles_event_categoriesSearch = new clsRecordarticles_event_categoriesSearch Set articles_event_categories = New clsGridarticles_event_categories Set Label1 = CCCreateControl(ccsLabel, "Label1", Empty, ccsText, Empty, CCGetRequestParam("Label1", ccsGet)) Label1.HTML = True Set articles = new clsRecordarticles Set Footer = New clsFooter Set Footer.Attributes = Attributes Footer.Initialize "Footer", "" articles_event_categories.Initialize DBInternet articles.Initialize DBInternet ' Events %> <% BindEvents Empty CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-65E9BEDD Header.Operations articles_event_categoriesSearch.Operation articles.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-2E9DB4BC CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate 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-2A43700A Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Header, articles_event_categoriesSearch, articles_event_categories, Label1, articles, 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-1863439A Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBInternet.State = adStateOpen Then _ DBInternet.Close Set DBInternet = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Header.UnloadPage Set Header = Nothing Set articles_event_categoriesSearch = Nothing Set articles_event_categories = Nothing Set articles = Nothing Footer.UnloadPage Set Footer = Nothing End Sub 'End UnloadPage Sub Class clsRecordarticles_event_categoriesSearch 'articles_event_categoriesSearch Class @17-8DB47FDD 'articles_event_categoriesSearch Variables @17-EA0C5B7B ' 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_article_title Dim ClearParameters Dim Button_DoSearch 'End articles_event_categoriesSearch Variables 'articles_event_categoriesSearch Class_Initialize Event @17-B7AC24B3 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) = "articles_event_categoriesSearch") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "articles_event_categoriesSearch" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set s_article_title = CCCreateControl(ccsTextBox, "s_article_title", Empty, ccsText, Empty, CCGetRequestParam("s_article_title", Method)) 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_article_title) End Sub 'End articles_event_categoriesSearch Class_Initialize Event 'articles_event_categoriesSearch Class_Terminate Event @17-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End articles_event_categoriesSearch Class_Terminate Event 'articles_event_categoriesSearch Validate Method @17-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End articles_event_categoriesSearch Validate Method 'articles_event_categoriesSearch Operation Method @17-A7706DDE 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 = "Article.asp" If Validate() Then If PressedButton = "Button_DoSearch" Then If NOT Button_DoSearch.OnClick() Then Redirect = "" Else Redirect = "Article.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 articles_event_categoriesSearch Operation Method 'articles_event_categoriesSearch Show Method @17-F781D6DD Sub Show(Tpl) If NOT Visible Then Exit Sub EditMode = False HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "articles_event_categoriesSearch" & 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_article_title, ClearParameters, Button_DoSearch)) ClearParameters.Parameters = CCGetQueryString("QueryString", Array("s_article_title", "ccsForm")) ClearParameters.Page = "Article.asp" If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors s_article_title.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, "articles_event_categoriesSearch" & ":" Controls.Show End If End Sub 'End articles_event_categoriesSearch Show Method End Class 'End articles_event_categoriesSearch Class @17-A61BA892 Class clsGridarticles_event_categories 'articles_event_categories Class @10-E4B4FCD9 'articles_event_categories Variables @10-29C911F9 ' 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 Recordset Private CCSEventResult ' Grid Controls Public StaticControls, RowControls, NoRecordsControls Dim article_title Dim Navigator 'End articles_event_categories Variables 'articles_event_categories Class_Initialize Event @10-9FC05F0C Private Sub Class_Initialize() ComponentName = "articles_event_categories" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set Errors = New clsErrors Set DataSource = New clsarticles_event_categoriesDataSource 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 = 15 _ 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 Set article_title = CCCreateControl(ccsLink, "article_title", Empty, ccsText, Empty, CCGetRequestParam("article_title", ccsGet)) Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple) Navigator.PageSizes = Array("1", "5", "10", "25", "50") IsDSEmpty = True End Sub 'End articles_event_categories Class_Initialize Event 'articles_event_categories Initialize Method @10-57CE6952 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection DataSource.PageSize = PageSize DataSource.AbsolutePage = PageNumber End Sub 'End articles_event_categories Initialize Method 'articles_event_categories Class_Terminate Event @10-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End articles_event_categories Class_Terminate Event 'articles_event_categories Show Method @10-E0DAC052 Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock, SeparatorBlock, NoRecordsBlock With DataSource .Parameters("urls_article_title") = CCGetRequestParam("s_article_title", ccsGET) .Parameters("expr51") = 7 .Parameters("expr55") = 1 .Parameters("expr56") = 2 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 SeparatorBlock = TemplateBlock.Block("Separator") Set NoRecordsBlock = TemplateBlock.Block("NoRecords") Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Navigator)) Navigator.PageSize = PageSize Navigator.SetDataSource Recordset Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _ Array(article_title)) 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, "articles_event_categories:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If HasNext Then article_title.Value = Recordset.Fields("article_title") article_title.Link = "" article_title.Parameters = CCAddParam(article_title.Parameters, "article_id", Recordset.Fields("article_title_param1")) article_title.Page = "Article.asp" End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "articles_event_categories:" RowControls.Show If HasNext Then Recordset.MoveNext ShownRecords = ShownRecords + 1 ' Parse Separator If NOT Recordset.EOF AND ShownRecords < PageSize Then _ SeparatorBlock.ParseTo ccsParseAccumulate, RowBlock HasNext = HasNextRow() Loop Attributes.Show TemplateBlock, "articles_event_categories:" StaticControls.Show End If End Sub 'End articles_event_categories Show Method 'articles_event_categories PageSize Property Let @10-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End articles_event_categories PageSize Property Let 'articles_event_categories PageSize Property Get @10-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End articles_event_categories PageSize Property Get 'articles_event_categories RowNumber Property Get @10-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End articles_event_categories RowNumber Property Get 'articles_event_categories HasNextRow Function @10-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End articles_event_categories HasNextRow Function End Class 'End articles_event_categories Class @10-A61BA892 Class clsarticles_event_categoriesDataSource 'articles_event_categoriesDataSource Class @10-83EDE6BE 'DataSource Variables @10-F4663C9D 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 article_title Public article_title_param1 'End DataSource Variables 'DataSource Class_Initialize Event @10-9C14464C 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 article_title = CCCreateField("article_title", "article_title", ccsText, Empty, Recordset) Set article_title_param1 = CCCreateField("article_title_param1", "article_id", ccsText, Empty, Recordset) Fields.AddFields Array(article_title, article_title_param1) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT TOP {SqlParam_endRecord} article_id, article_title, category_name " & vbLf & _ "FROM articles INNER JOIN event_categories ON " & vbLf & _ "articles.category_id = event_categories.category_id {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM articles INNER JOIN event_categories ON " & vbLf & _ "articles.category_id = event_categories.category_id" Where = "" Order = "article_title" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @10-BDEDD633 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, "urls_article_title", ccsText, Empty, Empty, Empty, False .AddParameter 2, "expr51", ccsInteger, Empty, Empty, Empty, False .AddParameter 3, "expr55", ccsInteger, Empty, Empty, Empty, False .AddParameter 4, "expr56", ccsInteger, Empty, Empty, Empty, False .Criterion(1) = .Operation(opContains, False, "article_title", .getParamByID(1)) .Criterion(2) = .Operation(opNotEqual, False, "articles.category_id", .getParamByID(2)) .Criterion(3) = .Operation(opNotEqual, False, "articles.article_id", .getParamByID(3)) .Criterion(4) = .Operation(opNotEqual, False, "articles.article_id", .getParamByID(4)) .AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)), .Criterion(4)) 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 @10-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 @10-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 articles_event_categoriesDataSource Class @10-A61BA892 Class clsRecordarticles 'articles Class @4-7480CC0A 'articles Variables @4-50191DDE ' 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 article_title Dim article_desc 'End articles Variables 'articles Class_Initialize Event @4-9E0FF7D4 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set DataSource = New clsarticlesDataSource Set Command = New clsCommand 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) = "articles") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "articles" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set article_title = CCCreateControl(ccsLabel, "article_title", Empty, ccsText, Empty, CCGetRequestParam("article_title", Method)) Set article_desc = CCCreateControl(ccsLabel, "article_desc", Empty, ccsMemo, Empty, CCGetRequestParam("article_desc", Method)) article_desc.HTML = True Set ValidatingControls = new clsControls End Sub 'End articles Class_Initialize Event 'articles Initialize Method @4-F272F10D Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection With DataSource .Parameters("urlarticle_id") = CCGetRequestParam("article_id", ccsGET) End With End Sub 'End articles Initialize Method 'articles Class_Terminate Event @4-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End articles Class_Terminate Event 'articles Validate Method @4-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End articles Validate Method 'articles Operation Method @4-0AF3B979 Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub Redirect = "default.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End Sub 'End articles Operation Method 'articles Show Method @4-8E7E1251 Sub Show(Tpl) If NOT Visible Then Exit Sub CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) EditMode = Recordset.EditMode(ReadAllowed) HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "articles" & 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" If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString .Parse False End With End If Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(article_title, article_desc)) If EditMode AND ReadAllowed Then If Errors.Count = 0 Then If Recordset.Errors.Count > 0 Then With TemplateBlock.Block("Error") .Variable("Error") = Recordset.Errors.ToString .Parse False End With ElseIf Recordset.CanPopulate() Then If Not FormSubmitted Then End If Else EditMode = False End If End If If EditMode Then article_title.Value = Recordset.Fields("article_title") article_desc.Value = Recordset.Fields("article_desc") End If End If If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors DataSource.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, "articles" & ":" Controls.Show End If End Sub 'End articles Show Method End Class 'End articles Class @4-A61BA892 Class clsarticlesDataSource 'articlesDataSource Class @4-8538FF5D 'DataSource Variables @4-6D6AA8AC 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 article_title Public article_desc 'End DataSource Variables 'DataSource Class_Initialize Event @4-5ACFAF77 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 article_title = CCCreateField("article_title", "article_title", ccsText, Empty, Recordset) Set article_desc = CCCreateField("article_desc", "article_desc", ccsMemo, Empty, Recordset) Fields.AddFields Array(article_title, article_desc) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT * " & vbLf & _ "FROM articles {SQL_Where} {SQL_OrderBy}" Where = "" Order = "" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @4-21F38639 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, "urlarticle_id", ccsInteger, Empty, Empty, Empty, False AllParamsSet = .AllParamsSet .Criterion(1) = .Operation(opEqual, False, "article_id", .getParamByID(1)) .AssembledWhere = .Criterion(1) 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 @4-48A2DA7D 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 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 If Not AllParamsSet Then Set Open = New clsEmptyDataSource Exit Function End If 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 @4-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 articlesDataSource Class @4-A61BA892 'Include Page Implementation @2-A598DFC6 %> <% 'End Include Page Implementation 'Include Page Implementation @3-9D89A721 %> <% 'End Include Page Implementation %>