<%@ CodePage=1252 %> <% 'Include Common Files @1-07AFC038 %> <% 'End Include Common Files 'Initialize Page @1-A93D1FDB ' 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 Label1 Dim Category_Desc Dim CNC_Categories Dim CNC_Equipment Dim Footer Dim ChildControls Response.ContentType = CCSContentType IsService = False Redirect = "" TemplateFileName = "parts.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "parts.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-D0A9AD8F 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 Label1 = CCCreateControl(ccsLabel, "Label1", Empty, ccsText, Empty, CCGetRequestParam("Label1", ccsGet)) Set Category_Desc = CCCreateControl(ccsLabel, "Category_Desc", Empty, ccsText, Empty, CCGetRequestParam("Category_Desc", ccsGet)) Set CNC_Categories = New clsGridCNC_Categories Set CNC_Equipment = New clsGridCNC_Equipment Set Footer = New clsFooter Set Footer.Attributes = Attributes Footer.Initialize "Footer", "" CNC_Categories.Initialize DBInternet CNC_Equipment.Initialize DBInternet ' Events %> <% BindEvents Empty CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-3DAD5F6C Header.Operations 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-41E8986E Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Header, Label1, Category_Desc, CNC_Categories, CNC_Equipment, 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-21FCEA9F 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 CNC_Categories = Nothing Set CNC_Equipment = Nothing Footer.UnloadPage Set Footer = Nothing End Sub 'End UnloadPage Sub Class clsGridCNC_Categories 'CNC_Categories Class @157-06FF0C63 'CNC_Categories Variables @157-745C5801 ' 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 Public AltRowControls Public RenderAltRow Dim Desc Dim CNC_Parent_ID Dim CNC_Category_ID Dim CNC_Category_image Dim Alt_Desc Dim Alt_CNC_Category_ID Dim Alt_CNC_Parent_ID Dim Alt_CNC_Category_image Dim Navigator 'End CNC_Categories Variables 'CNC_Categories Class_Initialize Event @157-F2D27D2A Private Sub Class_Initialize() ComponentName = "CNC_Categories" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes RenderAltRow = False Set Errors = New clsErrors Set DataSource = New clsCNC_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 = 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 Set Desc = CCCreateControl(ccsLink, "Desc", Empty, ccsMemo, Empty, CCGetRequestParam("Desc", ccsGet)) Set CNC_Parent_ID = CCCreateControl(ccsHidden, "CNC_Parent_ID", Empty, ccsInteger, Empty, CCGetRequestParam("CNC_Parent_ID", ccsGet)) Set CNC_Category_ID = CCCreateControl(ccsHidden, "CNC_Category_ID", Empty, ccsInteger, Empty, CCGetRequestParam("CNC_Category_ID", ccsGet)) Set CNC_Category_image = CCCreateControl(ccsLabel, "CNC_Category_image", Empty, ccsText, Empty, CCGetRequestParam("CNC_Category_image", ccsGet)) CNC_Category_image.HTML = True Set Alt_Desc = CCCreateControl(ccsLink, "Alt_Desc", Empty, ccsMemo, Empty, CCGetRequestParam("Alt_Desc", ccsGet)) Set Alt_CNC_Category_ID = CCCreateControl(ccsHidden, "Alt_CNC_Category_ID", Empty, ccsInteger, Empty, CCGetRequestParam("Alt_CNC_Category_ID", ccsGet)) Set Alt_CNC_Parent_ID = CCCreateControl(ccsHidden, "Alt_CNC_Parent_ID", Empty, ccsInteger, Empty, CCGetRequestParam("Alt_CNC_Parent_ID", ccsGet)) Set Alt_CNC_Category_image = CCCreateControl(ccsLabel, "Alt_CNC_Category_image", Empty, ccsText, Empty, CCGetRequestParam("Alt_CNC_Category_image", ccsGet)) Alt_CNC_Category_image.HTML = True Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple) Navigator.PageSizes = Array("1", "5", "10", "25", "50") IsDSEmpty = True End Sub 'End CNC_Categories Class_Initialize Event 'CNC_Categories Initialize Method @157-57CE6952 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection DataSource.PageSize = PageSize DataSource.AbsolutePage = PageNumber End Sub 'End CNC_Categories Initialize Method 'CNC_Categories Class_Terminate Event @157-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End CNC_Categories Class_Terminate Event 'CNC_Categories Show Method @157-691E6719 Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock, SeparatorBlock, AltRowBlock, NoRecordsBlock With DataSource .Parameters("expr174") = 3 .Parameters("expr175") = 4 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 AltRowBlock = TemplateBlock.Block("AltRow") 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(Desc, CNC_Parent_ID, CNC_Category_ID, CNC_Category_image)) Set AltRowControls = CCCreateCollection(AltRowBlock, RowBlock, ccsParseAccumulate, _ Array(Alt_Desc, Alt_CNC_Category_ID, Alt_CNC_Parent_ID, Alt_CNC_Category_image)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub RowControls.PreserveControlsVisible AltRowControls.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, "CNC_Categories:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If RenderAltRow Then If HasNext Then Alt_Desc.Value = Recordset.Fields("Alt_Desc") Alt_Desc.Link = "" Alt_Desc.Parameters = CCAddParam(Alt_Desc.Parameters, "CNC_Category_ID", Recordset.Fields("Alt_Desc_param1")) Alt_Desc.Page = "parts.asp" Alt_CNC_Category_ID.Value = Recordset.Fields("Alt_CNC_Category_ID") Alt_CNC_Parent_ID.Value = Recordset.Fields("Alt_CNC_Parent_ID") Alt_CNC_Category_image.Value = Recordset.Fields("Alt_CNC_Category_image") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("AltRow"), "CNC_Categories:" AltRowControls.Show Else If HasNext Then Desc.Value = Recordset.Fields("Desc") Desc.Link = "" Desc.Parameters = CCAddParam(Desc.Parameters, "CNC_Category_ID", Recordset.Fields("Desc_param1")) Desc.Page = "parts.asp" CNC_Parent_ID.Value = Recordset.Fields("CNC_Parent_ID") CNC_Category_ID.Value = Recordset.Fields("CNC_Category_ID") CNC_Category_image.Value = Recordset.Fields("CNC_Category_image") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "CNC_Categories:" RowControls.Show End If RenderAltRow = NOT RenderAltRow 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, "CNC_Categories:" StaticControls.Show End If End Sub 'End CNC_Categories Show Method 'CNC_Categories PageSize Property Let @157-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End CNC_Categories PageSize Property Let 'CNC_Categories PageSize Property Get @157-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End CNC_Categories PageSize Property Get 'CNC_Categories RowNumber Property Get @157-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End CNC_Categories RowNumber Property Get 'CNC_Categories HasNextRow Function @157-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End CNC_Categories HasNextRow Function End Class 'End CNC_Categories Class @157-A61BA892 Class clsCNC_CategoriesDataSource 'CNC_CategoriesDataSource Class @157-58BF2403 'DataSource Variables @157-53F3A46B 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 Desc Public Desc_param1 Public CNC_Parent_ID Public CNC_Parent_ID_param1 Public CNC_Category_ID Public CNC_Category_image Public Alt_Desc Public Alt_Desc_param1 Public Alt_CNC_Category_ID Public Alt_CNC_Parent_ID Public Alt_CNC_Category_image 'End DataSource Variables 'DataSource Class_Initialize Event @157-272C3348 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 Desc = CCCreateField("Desc", "Desc", ccsMemo, Empty, Recordset) Set Desc_param1 = CCCreateField("Desc_param1", "CNC_Category_ID", ccsText, Empty, Recordset) Set CNC_Parent_ID = CCCreateField("CNC_Parent_ID", "CNC_Parent_ID", ccsInteger, Empty, Recordset) Set CNC_Parent_ID_param1 = CCCreateField("CNC_Parent_ID_param1", "CNC_Parent_ID", ccsText, Empty, Recordset) Set CNC_Category_ID = CCCreateField("CNC_Category_ID", "CNC_Category_ID", ccsInteger, Empty, Recordset) Set CNC_Category_image = CCCreateField("CNC_Category_image", "CNC_Category_image", ccsText, Empty, Recordset) Set Alt_Desc = CCCreateField("Alt_Desc", "Desc", ccsMemo, Empty, Recordset) Set Alt_Desc_param1 = CCCreateField("Alt_Desc_param1", "CNC_Category_ID", ccsText, Empty, Recordset) Set Alt_CNC_Category_ID = CCCreateField("Alt_CNC_Category_ID", "CNC_Category_ID", ccsInteger, Empty, Recordset) Set Alt_CNC_Parent_ID = CCCreateField("Alt_CNC_Parent_ID", "CNC_Parent_ID", ccsInteger, Empty, Recordset) Set Alt_CNC_Category_image = CCCreateField("Alt_CNC_Category_image", "CNC_Category_image", ccsText, Empty, Recordset) Fields.AddFields Array(Desc, Desc_param1, CNC_Parent_ID, CNC_Parent_ID_param1, CNC_Category_ID, CNC_Category_image, Alt_Desc, _ Alt_Desc_param1, Alt_CNC_Category_ID, Alt_CNC_Parent_ID, Alt_CNC_Category_image) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT TOP {SqlParam_endRecord} * " & vbLf & _ "FROM CNC_Categories {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM CNC_Categories" Where = "" Order = "CNC_Category_ID desc" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @157-ED1099CA 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, "expr174", ccsInteger, Empty, Empty, Empty, True .AddParameter 2, "expr175", ccsInteger, Empty, Empty, Empty, True .Criterion(1) = .Operation(opEqual, False, "CNC_Category_ID", .getParamByID(1)) .Criterion(2) = .Operation(opEqual, False, "CNC_Category_ID", .getParamByID(2)) .AssembledWhere = .opOR(False, .Criterion(1), .Criterion(2)) 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 @157-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 @157-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 CNC_CategoriesDataSource Class @157-A61BA892 Class clsGridCNC_Equipment 'CNC_Equipment Class @109-DC960FA7 'CNC_Equipment Variables @109-67AB4B07 ' 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 Public AltRowControls Public RenderAltRow Dim Sorter_CNC_Equipment_Name Dim CNC_Equipment_Name Dim CNC_Category_ID Dim Alt_CNC_Equipment_Name Dim Alt_CNC_Category_ID Dim Navigator 'End CNC_Equipment Variables 'CNC_Equipment Class_Initialize Event @109-F878B082 Private Sub Class_Initialize() ComponentName = "CNC_Equipment" Visible = True Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes RenderAltRow = False Set Errors = New clsErrors Set DataSource = New clsCNC_EquipmentDataSource 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("CNC_EquipmentOrder", Empty) SortingDirection = CCGetParam("CNC_EquipmentDir", Empty) If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _ SortingDirection = Empty Set Sorter_CNC_Equipment_Name = CCCreateSorter("Sorter_CNC_Equipment_Name", Me, FileName) Set CNC_Equipment_Name = CCCreateControl(ccsLink, "CNC_Equipment_Name", Empty, ccsText, Empty, CCGetRequestParam("CNC_Equipment_Name", ccsGet)) Set CNC_Category_ID = CCCreateControl(ccsHidden, "CNC_Category_ID", Empty, ccsInteger, Empty, CCGetRequestParam("CNC_Category_ID", ccsGet)) Set Alt_CNC_Equipment_Name = CCCreateControl(ccsLink, "Alt_CNC_Equipment_Name", Empty, ccsText, Empty, CCGetRequestParam("Alt_CNC_Equipment_Name", ccsGet)) Set Alt_CNC_Category_ID = CCCreateControl(ccsHidden, "Alt_CNC_Category_ID", Empty, ccsInteger, Empty, CCGetRequestParam("Alt_CNC_Category_ID", ccsGet)) Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple) Navigator.PageSizes = Array("1", "5", "10", "25", "50") IsDSEmpty = True End Sub 'End CNC_Equipment Class_Initialize Event 'CNC_Equipment Initialize Method @109-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 CNC_Equipment Initialize Method 'CNC_Equipment Class_Terminate Event @109-B97CC660 Private Sub Class_Terminate() Set CCSEvents = Nothing Set DataSource = Nothing Set Command = Nothing Set Errors = Nothing Set Attributes = Nothing End Sub 'End CNC_Equipment Class_Terminate Event 'CNC_Equipment Show Method @109-735C5530 Sub Show(Tpl) Dim HasNext If NOT Visible Then Exit Sub Dim RowBlock, SeparatorBlock, AltRowBlock, NoRecordsBlock With DataSource .Parameters("urlCNC_Category_ID") = CCGetRequestParam("CNC_Category_ID", 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 SeparatorBlock = TemplateBlock.Block("Separator") Set AltRowBlock = TemplateBlock.Block("AltRow") Set NoRecordsBlock = TemplateBlock.Block("NoRecords") Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(Sorter_CNC_Equipment_Name, Navigator)) Navigator.PageSize = PageSize Navigator.SetDataSource Recordset Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _ Array(CNC_Equipment_Name, CNC_Category_ID)) Set AltRowControls = CCCreateCollection(AltRowBlock, RowBlock, ccsParseAccumulate, _ Array(Alt_CNC_Equipment_Name, Alt_CNC_Category_ID)) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If NOT Visible Then Exit Sub RowControls.PreserveControlsVisible AltRowControls.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, "CNC_Equipment:" TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite End If HasNext = HasNextRow() ForceIteration = False Do While ForceIteration Or HasNext Attributes("rowNumber") = ShownRecords + 1 If RenderAltRow Then If HasNext Then Alt_CNC_Equipment_Name.Value = Recordset.Fields("Alt_CNC_Equipment_Name") Alt_CNC_Equipment_Name.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) Alt_CNC_Equipment_Name.Parameters = CCAddParam(Alt_CNC_Equipment_Name.Parameters, "CNC_Equipment_ID", Recordset.Fields("Alt_CNC_Equipment_Name_param1")) Alt_CNC_Equipment_Name.Page = "equipment_detail.asp" Alt_CNC_Category_ID.Value = Recordset.Fields("Alt_CNC_Category_ID") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("AltRow"), "CNC_Equipment:" AltRowControls.Show Else If HasNext Then CNC_Equipment_Name.Value = Recordset.Fields("CNC_Equipment_Name") CNC_Equipment_Name.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) CNC_Equipment_Name.Parameters = CCAddParam(CNC_Equipment_Name.Parameters, "CNC_Equipment_ID", Recordset.Fields("CNC_Equipment_Name_param1")) CNC_Equipment_Name.Page = "equipment_detail.asp" CNC_Category_ID.Value = Recordset.Fields("CNC_Category_ID") End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me) Attributes.Show TemplateBlock.Block("Row"), "CNC_Equipment:" RowControls.Show End If RenderAltRow = NOT RenderAltRow 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, "CNC_Equipment:" StaticControls.Show End If End Sub 'End CNC_Equipment Show Method 'CNC_Equipment PageSize Property Let @109-54E46DD6 Public Property Let PageSize(NewValue) VarPageSize = NewValue DataSource.PageSize = NewValue End Property 'End CNC_Equipment PageSize Property Let 'CNC_Equipment PageSize Property Get @109-9AA1D1E9 Public Property Get PageSize() PageSize = VarPageSize End Property 'End CNC_Equipment PageSize Property Get 'CNC_Equipment RowNumber Property Get @109-F32EE2C6 Public Property Get RowNumber() RowNumber = ShownRecords + 1 End Property 'End CNC_Equipment RowNumber Property Get 'CNC_Equipment HasNextRow Function @109-9BECE27A Public Function HasNextRow() HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize End Function 'End CNC_Equipment HasNextRow Function End Class 'End CNC_Equipment Class @109-A61BA892 Class clsCNC_EquipmentDataSource 'CNC_EquipmentDataSource Class @109-49A62DF1 'DataSource Variables @109-42885560 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 CNC_Equipment_Name Public CNC_Equipment_Name_param1 Public CNC_Category_ID Public Alt_CNC_Equipment_Name Public Alt_CNC_Equipment_Name_param1 Public Alt_CNC_Category_ID 'End DataSource Variables 'DataSource Class_Initialize Event @109-4819BF32 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 CNC_Equipment_Name = CCCreateField("CNC_Equipment_Name", "CNC_Equipment_Name", ccsText, Empty, Recordset) Set CNC_Equipment_Name_param1 = CCCreateField("CNC_Equipment_Name_param1", "CNC_Equipment_ID", ccsText, Empty, Recordset) Set CNC_Category_ID = CCCreateField("CNC_Category_ID", "CNC_Category_ID", ccsInteger, Empty, Recordset) Set Alt_CNC_Equipment_Name = CCCreateField("Alt_CNC_Equipment_Name", "CNC_Equipment_Name", ccsText, Empty, Recordset) Set Alt_CNC_Equipment_Name_param1 = CCCreateField("Alt_CNC_Equipment_Name_param1", "CNC_Equipment_ID", ccsText, Empty, Recordset) Set Alt_CNC_Category_ID = CCCreateField("Alt_CNC_Category_ID", "CNC_Category_ID", ccsInteger, Empty, Recordset) Fields.AddFields Array(CNC_Equipment_Name, CNC_Equipment_Name_param1, CNC_Category_ID, Alt_CNC_Equipment_Name, Alt_CNC_Equipment_Name_param1, Alt_CNC_Category_ID) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing Orders = Array( _ Array("Sorter_CNC_Equipment_Name", "CNC_Equipment_Name", "")) SQL = "SELECT TOP {SqlParam_endRecord} * " & vbLf & _ "FROM CNC_Equipment {SQL_Where} {SQL_OrderBy}" CountSQL = "SELECT COUNT(*) " & vbLf & _ "FROM CNC_Equipment" Where = "" Order = "CNC_Equipment_Name" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'SetOrder Method @109-68FC9576 Sub SetOrder(Column, Direction) Order = Recordset.GetOrder(Order, Column, Direction, Orders) End Sub 'End SetOrder Method 'BuildTableWhere Method @109-80DC71E3 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, "urlCNC_Category_ID", ccsInteger, Empty, Empty, Empty, True .Criterion(1) = .Operation(opEqual, False, "CNC_Category_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 @109-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 @109-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 CNC_EquipmentDataSource Class @109-A61BA892 'Include Page Implementation @2-A598DFC6 %> <% 'End Include Page Implementation 'Include Page Implementation @3-9D89A721 %> <% 'End Include Page Implementation %>