<%@ CodePage=1252 %> <% 'Include Common Files @1-C42A9701 %> <% 'End Include Common Files 'Initialize Page @1-E84890F9 ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBConnection1 ' Page controls Dim info Dim ChildControls Redirect = "" TemplateFileName = "Step1.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "Step1.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-BB31F8FF Set DBConnection1 = New clsDBConnection1 DBConnection1.Open Set Attributes = New clsAttributes ' Controls Set info = new clsRecordinfo info.Initialize DBConnection1 ' Events %> <% BindEvents CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-2F8B7755 info.Operation '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-203084B9 Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(info)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False 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-C85C6133 Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBConnection1.State = adStateOpen Then _ DBConnection1.Close Set DBConnection1 = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Set info = Nothing End Sub 'End UnloadPage Sub Class clsRecordinfo 'info Class @2-76505E60 'info Variables @2-A15100FB ' 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 fname Dim lname Dim address Dim city Dim st Dim zip Dim dtel Dim wtel Dim mtel Dim email Dim contime Dim dob Dim yrsdrive Dim gend Dim drivnum Dim licst Dim driveed Dim RadioButton1 Dim SDIP Dim Hidden1 Dim Button1 Dim Button2 Dim Button_Insert 'End info Variables 'info Class_Initialize Event @2-2D54AC68 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set DataSource = New clsinfoDataSource Set Command = New clsCommand InsertAllowed = True UpdateAllowed = True DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "info") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "info" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set fname = CCCreateControl(ccsTextBox, "fname", "First Name", ccsText, Empty, CCGetRequestParam("fname", Method)) fname.Required = True Set lname = CCCreateControl(ccsTextBox, "lname", "Last Name", ccsText, Empty, CCGetRequestParam("lname", Method)) lname.Required = True Set address = CCCreateControl(ccsTextBox, "address", "Address", ccsText, Empty, CCGetRequestParam("address", Method)) Set city = CCCreateControl(ccsTextBox, "city", "City", ccsText, Empty, CCGetRequestParam("city", Method)) Set st = CCCreateList(ccsListBox, "st", "St", ccsText, CCGetRequestParam("st", Method), Empty) Set st.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("MA"), _ Array("Massachusetts"))) Set zip = CCCreateControl(ccsTextBox, "zip", "Zip", ccsText, Empty, CCGetRequestParam("zip", Method)) Set dtel = CCCreateControl(ccsTextBox, "dtel", "Dtel", ccsText, Empty, CCGetRequestParam("dtel", Method)) Set wtel = CCCreateControl(ccsTextBox, "wtel", "Wtel", ccsText, Empty, CCGetRequestParam("wtel", Method)) Set mtel = CCCreateControl(ccsTextBox, "mtel", "Mtel", ccsText, Empty, CCGetRequestParam("mtel", Method)) Set email = CCCreateControl(ccsTextBox, "email", "Email Address", ccsText, Empty, CCGetRequestParam("email", Method)) email.Required = True Set contime = CCCreateList(ccsRadioButton, "contime", "Contime", ccsText, CCGetRequestParam("contime", Method), Empty) Set contime.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("Day", "Night"), _ Array("Day", "Night"))) contime.HTML = True Set dob = CCCreateControl(ccsTextBox, "dob", "Date of Birth", ccsDate, Array("ShortDate"), CCGetRequestParam("dob", Method)) dob.Required = True Set yrsdrive = CCCreateControl(ccsTextBox, "yrsdrive", "Years Driving", ccsInteger, Empty, CCGetRequestParam("yrsdrive", Method)) yrsdrive.Required = True Set gend = CCCreateList(ccsRadioButton, "gend", "Gend", ccsText, CCGetRequestParam("gend", Method), Empty) Set gend.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("M", "F"), _ Array("Male", "Female"))) gend.HTML = True Set drivnum = CCCreateControl(ccsTextBox, "drivnum", "Driver License Number", ccsText, Empty, CCGetRequestParam("drivnum", Method)) drivnum.Required = True Set licst = CCCreateList(ccsListBox, "licst", "Licst", ccsText, CCGetRequestParam("licst", Method), Empty) licst.BoundColumn = "st" licst.TextColumn = "st_name" Set licst.DataSource = CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _ "FROM st_name {SQL_Where} {SQL_OrderBy}", "", "")) Set driveed = CCCreateList(ccsRadioButton, "driveed", "Driveed", ccsText, CCGetRequestParam("driveed", Method), Empty) Set driveed.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("Y", "N"), _ Array("Yes", "No"))) driveed.HTML = True Set RadioButton1 = CCCreateList(ccsRadioButton, "RadioButton1", Empty, ccsText, CCGetRequestParam("RadioButton1", Method), Empty) Set RadioButton1.DataSource = CCCreateDataSource(dsListOfValues, Empty, Array( _ Array("Y", "N"), _ Array("Yes", "No"))) RadioButton1.HTML = True Set SDIP = CCCreateControl(ccsTextBox, "SDIP", "SDIP", ccsText, Empty, CCGetRequestParam("SDIP", Method)) Set Hidden1 = CCCreateControl(ccsHidden, "Hidden1", Empty, ccsDate, Array("GeneralDate"), CCGetRequestParam("Hidden1", Method)) Set Button1 = CCCreateButton("Button1", Method) Set Button2 = CCCreateButton("Button2", Method) Set Button_Insert = CCCreateButton("Button_Insert", Method) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(fname, lname, address, city, st, zip, dtel, _ wtel, mtel, email, contime, dob, yrsdrive, gend, drivnum, _ licst, driveed, RadioButton1, SDIP, Hidden1) If Not FormSubmitted Then If IsEmpty(Hidden1.Value) Then _ Hidden1.Value = Now End If End Sub 'End info Class_Initialize Event 'info Initialize Method @2-0D1B156B Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection With DataSource .Parameters("sesdrivnum") = Session("drivnum") End With End Sub 'End info Initialize Method 'info Class_Terminate Event @2-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End info Class_Terminate Event 'info Validate Method @2-12DEC108 Function Validate() Dim Validation Dim Where If EditMode Then DataSource.BuildTableWhere If DataSource.Where <> "" Then _ Where = " AND NOT (" & DataSource.Where & ")" End If If drivnum.Errors.Count = 0 Then _ If CInt(CCDLookUp("COUNT(*)", " info", "drivnum =" & DBConnection1.ToSQL(drivnum.Value, drivnum.DataType) & Where, DBConnection1)) > 0 Then _ drivnum.Errors.addError(CCSLocales.GetText("CCS_UniqueValue", Array(drivnum.Caption))) ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End info Validate Method 'info Operation Method @2-578A330A Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = IIf(EditMode, "Button1", "Button2") If Button1.Pressed Then PressedButton = "Button1" ElseIf Button2.Pressed Then PressedButton = "Button2" ElseIf Button_Insert.Pressed Then PressedButton = "Button_Insert" End If End If Redirect = "Step2.asp" If Validate() Then If PressedButton = "Button1" Then If NOT Button1.OnClick() OR NOT UpdateRow() Then Redirect = "" Else Redirect = "Confirm.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End If ElseIf PressedButton = "Button2" Then If NOT Button2.OnClick() OR NOT InsertRow() Then Redirect = "" Else Redirect = "drv2.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End If ElseIf PressedButton = "Button_Insert" Then If NOT Button_Insert.OnClick() OR NOT InsertRow() Then Redirect = "" Else Redirect = "Step2.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End If End If Else Redirect = "" End If End Sub 'End info Operation Method 'info InsertRow Method @2-04BAE103 Function InsertRow() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInsert", Me) If NOT InsertAllowed Then InsertRow = False : Exit Function DataSource.fname.Value = fname.Value DataSource.lname.Value = lname.Value DataSource.address.Value = address.Value DataSource.city.Value = city.Value DataSource.st.Value = st.Value DataSource.zip.Value = zip.Value DataSource.dtel.Value = dtel.Value DataSource.wtel.Value = wtel.Value DataSource.mtel.Value = mtel.Value DataSource.email.Value = email.Value DataSource.contime.Value = contime.Value DataSource.dob.Value = dob.Value DataSource.yrsdrive.Value = yrsdrive.Value DataSource.gend.Value = gend.Value DataSource.drivnum.Value = drivnum.Value DataSource.licst.Value = licst.Value DataSource.driveed.Value = driveed.Value DataSource.RadioButton1.Value = RadioButton1.Value DataSource.SDIP.Value = SDIP.Value DataSource.Hidden1.Value = Hidden1.Value DataSource.Insert(Command) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInsert", Me) If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear End If InsertRow = (Errors.Count = 0) End Function 'End info InsertRow Method 'info UpdateRow Method @2-EB724696 Function UpdateRow() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUpdate", Me) If NOT UpdateAllowed Then UpdateRow = False : Exit Function DataSource.fname.Value = fname.Value DataSource.lname.Value = lname.Value DataSource.address.Value = address.Value DataSource.city.Value = city.Value DataSource.st.Value = st.Value DataSource.zip.Value = zip.Value DataSource.dtel.Value = dtel.Value DataSource.wtel.Value = wtel.Value DataSource.mtel.Value = mtel.Value DataSource.email.Value = email.Value DataSource.contime.Value = contime.Value DataSource.dob.Value = dob.Value DataSource.yrsdrive.Value = yrsdrive.Value DataSource.gend.Value = gend.Value DataSource.drivnum.Value = drivnum.Value DataSource.licst.Value = licst.Value DataSource.driveed.Value = driveed.Value DataSource.RadioButton1.Value = RadioButton1.Value DataSource.SDIP.Value = SDIP.Value DataSource.Hidden1.Value = Hidden1.Value DataSource.Update(Command) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterUpdate", Me) If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear End If UpdateRow = (Errors.Count = 0) End Function 'End info UpdateRow Method 'info Show Method @2-A20CF47C 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", "info" & 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(fname, lname, address, city, st, zip, dtel, _ wtel, mtel, email, contime, dob, yrsdrive, gend, drivnum, _ licst, driveed, RadioButton1, SDIP, Hidden1, Button1, Button2, Button_Insert)) 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 fname.Value = Recordset.Fields("fname") lname.Value = Recordset.Fields("lname") address.Value = Recordset.Fields("address") city.Value = Recordset.Fields("city") st.Value = Recordset.Fields("st") zip.Value = Recordset.Fields("zip") dtel.Value = Recordset.Fields("dtel") wtel.Value = Recordset.Fields("wtel") mtel.Value = Recordset.Fields("mtel") email.Value = Recordset.Fields("email") contime.Value = Recordset.Fields("contime") dob.Value = Recordset.Fields("dob") yrsdrive.Value = Recordset.Fields("yrsdrive") gend.Value = Recordset.Fields("gend") drivnum.Value = Recordset.Fields("drivnum") licst.Value = Recordset.Fields("licst") driveed.Value = Recordset.Fields("driveed") RadioButton1.Value = Recordset.Fields("RadioButton1") SDIP.Value = Recordset.Fields("SDIP") Hidden1.Value = Recordset.Fields("Hidden1") End If Else EditMode = False End If End If End If If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors fname.Errors Errors.AddErrors lname.Errors Errors.AddErrors address.Errors Errors.AddErrors city.Errors Errors.AddErrors st.Errors Errors.AddErrors zip.Errors Errors.AddErrors dtel.Errors Errors.AddErrors wtel.Errors Errors.AddErrors mtel.Errors Errors.AddErrors email.Errors Errors.AddErrors contime.Errors Errors.AddErrors dob.Errors Errors.AddErrors yrsdrive.Errors Errors.AddErrors gend.Errors Errors.AddErrors drivnum.Errors Errors.AddErrors licst.Errors Errors.AddErrors driveed.Errors Errors.AddErrors RadioButton1.Errors Errors.AddErrors SDIP.Errors Errors.AddErrors Hidden1.Errors Errors.AddErrors DataSource.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = HTMLFormAction Button1.Visible = EditMode AND UpdateAllowed Button2.Visible = NOT EditMode AND InsertAllowed Button_Insert.Visible = NOT EditMode AND InsertAllowed CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "info" & ":" Controls.Show End If End Sub 'End info Show Method End Class 'End info Class @2-A61BA892 Class clsinfoDataSource 'infoDataSource Class @2-F6BE210C 'DataSource Variables @2-EF9BCFC6 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 fname Public lname Public address Public city Public st Public zip Public dtel Public wtel Public mtel Public email Public contime Public dob Public yrsdrive Public gend Public drivnum Public licst Public driveed Public RadioButton1 Public SDIP Public Hidden1 'End DataSource Variables 'DataSource Class_Initialize Event @2-88125B4A 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 fname = CCCreateField("fname", "fname", ccsText, Empty, Recordset) Set lname = CCCreateField("lname", "lname", ccsText, Empty, Recordset) Set address = CCCreateField("address", "address", ccsText, Empty, Recordset) Set city = CCCreateField("city", "city", ccsText, Empty, Recordset) Set st = CCCreateField("st", "st", ccsText, Empty, Recordset) Set zip = CCCreateField("zip", "zip", ccsText, Empty, Recordset) Set dtel = CCCreateField("dtel", "dtel", ccsText, Empty, Recordset) Set wtel = CCCreateField("wtel", "wtel", ccsText, Empty, Recordset) Set mtel = CCCreateField("mtel", "mtel", ccsText, Empty, Recordset) Set email = CCCreateField("email", "email", ccsText, Empty, Recordset) Set contime = CCCreateField("contime", "contime", ccsText, Empty, Recordset) Set dob = CCCreateField("dob", "dob", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset) Set yrsdrive = CCCreateField("yrsdrive", "yrsdrive", ccsInteger, Empty, Recordset) Set gend = CCCreateField("gend", "gend", ccsText, Empty, Recordset) Set drivnum = CCCreateField("drivnum", "drivnum", ccsText, Empty, Recordset) Set licst = CCCreateField("licst", "licst", ccsText, Empty, Recordset) Set driveed = CCCreateField("driveed", "driveed", ccsText, Empty, Recordset) Set RadioButton1 = CCCreateField("RadioButton1", "triplea", ccsText, Empty, Recordset) Set SDIP = CCCreateField("SDIP", "SDIP", ccsText, Empty, Recordset) Set Hidden1 = CCCreateField("Hidden1", "recdate", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset) Fields.AddFields Array(fname, lname, address, city, st, zip, dtel, _ wtel, mtel, email, contime, dob, yrsdrive, gend, drivnum, _ licst, driveed, RadioButton1, SDIP, Hidden1) Set InsertOmitIfEmpty = CreateObject("Scripting.Dictionary") InsertOmitIfEmpty.Add "fname", True InsertOmitIfEmpty.Add "lname", True InsertOmitIfEmpty.Add "address", True InsertOmitIfEmpty.Add "city", True InsertOmitIfEmpty.Add "st", True InsertOmitIfEmpty.Add "zip", True InsertOmitIfEmpty.Add "dtel", True InsertOmitIfEmpty.Add "wtel", True InsertOmitIfEmpty.Add "mtel", True InsertOmitIfEmpty.Add "email", True InsertOmitIfEmpty.Add "contime", True InsertOmitIfEmpty.Add "dob", True InsertOmitIfEmpty.Add "yrsdrive", True InsertOmitIfEmpty.Add "gend", True InsertOmitIfEmpty.Add "drivnum", True InsertOmitIfEmpty.Add "licst", True InsertOmitIfEmpty.Add "driveed", True InsertOmitIfEmpty.Add "RadioButton1", True InsertOmitIfEmpty.Add "SDIP", True InsertOmitIfEmpty.Add "Hidden1", True Set UpdateOmitIfEmpty = CreateObject("Scripting.Dictionary") UpdateOmitIfEmpty.Add "fname", True UpdateOmitIfEmpty.Add "lname", True UpdateOmitIfEmpty.Add "address", True UpdateOmitIfEmpty.Add "city", True UpdateOmitIfEmpty.Add "st", True UpdateOmitIfEmpty.Add "zip", True UpdateOmitIfEmpty.Add "dtel", True UpdateOmitIfEmpty.Add "wtel", True UpdateOmitIfEmpty.Add "mtel", True UpdateOmitIfEmpty.Add "email", True UpdateOmitIfEmpty.Add "contime", True UpdateOmitIfEmpty.Add "dob", True UpdateOmitIfEmpty.Add "yrsdrive", True UpdateOmitIfEmpty.Add "gend", True UpdateOmitIfEmpty.Add "drivnum", True UpdateOmitIfEmpty.Add "licst", True UpdateOmitIfEmpty.Add "driveed", True UpdateOmitIfEmpty.Add "RadioButton1", True UpdateOmitIfEmpty.Add "SDIP", True UpdateOmitIfEmpty.Add "Hidden1", True Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT TOP 1 * " & vbLf & _ "FROM info {SQL_Where} {SQL_OrderBy}" Where = "" Order = "" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @2-C866A3A1 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, "sesdrivnum", ccsText, Empty, Empty, Empty, False AllParamsSet = .AllParamsSet .Criterion(1) = .Operation(opEqual, False, "drivnum", .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 @2-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 @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 'Update Method @2-C4EF47A2 Sub Update(Cmd) CmdExecution = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildUpdate", Me) Set Cmd.Connection = Connection Cmd.CommandOperation = cmdExec Cmd.CommandType = dsTable Cmd.CommandParameters = Empty BuildTableWhere If NOT AllParamsSet Then Errors.AddError(CCSLocales.GetText("CCS_CustomOperationError_MissingParameters", Empty)) End If Dim IsDef_fname : IsDef_fname = CCIsDefined("fname", "Form") Dim IsDef_lname : IsDef_lname = CCIsDefined("lname", "Form") Dim IsDef_address : IsDef_address = CCIsDefined("address", "Form") Dim IsDef_city : IsDef_city = CCIsDefined("city", "Form") Dim IsDef_st : IsDef_st = CCIsDefined("st", "Form") Dim IsDef_zip : IsDef_zip = CCIsDefined("zip", "Form") Dim IsDef_dtel : IsDef_dtel = CCIsDefined("dtel", "Form") Dim IsDef_wtel : IsDef_wtel = CCIsDefined("wtel", "Form") Dim IsDef_mtel : IsDef_mtel = CCIsDefined("mtel", "Form") Dim IsDef_email : IsDef_email = CCIsDefined("email", "Form") Dim IsDef_contime : IsDef_contime = CCIsDefined("contime", "Form") Dim IsDef_dob : IsDef_dob = CCIsDefined("dob", "Form") Dim IsDef_yrsdrive : IsDef_yrsdrive = CCIsDefined("yrsdrive", "Form") Dim IsDef_gend : IsDef_gend = CCIsDefined("gend", "Form") Dim IsDef_drivnum : IsDef_drivnum = CCIsDefined("drivnum", "Form") Dim IsDef_licst : IsDef_licst = CCIsDefined("licst", "Form") Dim IsDef_driveed : IsDef_driveed = CCIsDefined("driveed", "Form") Dim IsDef_RadioButton1 : IsDef_RadioButton1 = CCIsDefined("RadioButton1", "Form") Dim IsDef_SDIP : IsDef_SDIP = CCIsDefined("SDIP", "Form") Dim IsDef_Hidden1 : IsDef_Hidden1 = CCIsDefined("Hidden1", "Form") If Not UpdateOmitIfEmpty("fname") Or IsDef_fname Then Cmd.AddSQLStrings "fname=" & Connection.ToSQL(fname, fname.DataType), Empty If Not UpdateOmitIfEmpty("lname") Or IsDef_lname Then Cmd.AddSQLStrings "lname=" & Connection.ToSQL(lname, lname.DataType), Empty If Not UpdateOmitIfEmpty("address") Or IsDef_address Then Cmd.AddSQLStrings "address=" & Connection.ToSQL(address, address.DataType), Empty If Not UpdateOmitIfEmpty("city") Or IsDef_city Then Cmd.AddSQLStrings "city=" & Connection.ToSQL(city, city.DataType), Empty If Not UpdateOmitIfEmpty("st") Or IsDef_st Then Cmd.AddSQLStrings "st=" & Connection.ToSQL(st, st.DataType), Empty If Not UpdateOmitIfEmpty("zip") Or IsDef_zip Then Cmd.AddSQLStrings "zip=" & Connection.ToSQL(zip, zip.DataType), Empty If Not UpdateOmitIfEmpty("dtel") Or IsDef_dtel Then Cmd.AddSQLStrings "dtel=" & Connection.ToSQL(dtel, dtel.DataType), Empty If Not UpdateOmitIfEmpty("wtel") Or IsDef_wtel Then Cmd.AddSQLStrings "wtel=" & Connection.ToSQL(wtel, wtel.DataType), Empty If Not UpdateOmitIfEmpty("mtel") Or IsDef_mtel Then Cmd.AddSQLStrings "mtel=" & Connection.ToSQL(mtel, mtel.DataType), Empty If Not UpdateOmitIfEmpty("email") Or IsDef_email Then Cmd.AddSQLStrings "email=" & Connection.ToSQL(email, email.DataType), Empty If Not UpdateOmitIfEmpty("contime") Or IsDef_contime Then Cmd.AddSQLStrings "contime=" & Connection.ToSQL(contime, contime.DataType), Empty If Not UpdateOmitIfEmpty("dob") Or IsDef_dob Then Cmd.AddSQLStrings "dob=" & Connection.ToSQL(dob, dob.DataType), Empty If Not UpdateOmitIfEmpty("yrsdrive") Or IsDef_yrsdrive Then Cmd.AddSQLStrings "yrsdrive=" & Connection.ToSQL(yrsdrive, yrsdrive.DataType), Empty If Not UpdateOmitIfEmpty("gend") Or IsDef_gend Then Cmd.AddSQLStrings "gend=" & Connection.ToSQL(gend, gend.DataType), Empty If Not UpdateOmitIfEmpty("drivnum") Or IsDef_drivnum Then Cmd.AddSQLStrings "drivnum=" & Connection.ToSQL(drivnum, drivnum.DataType), Empty If Not UpdateOmitIfEmpty("licst") Or IsDef_licst Then Cmd.AddSQLStrings "licst=" & Connection.ToSQL(licst, licst.DataType), Empty If Not UpdateOmitIfEmpty("driveed") Or IsDef_driveed Then Cmd.AddSQLStrings "driveed=" & Connection.ToSQL(driveed, driveed.DataType), Empty If Not UpdateOmitIfEmpty("RadioButton1") Or IsDef_RadioButton1 Then Cmd.AddSQLStrings "triplea=" & Connection.ToSQL(RadioButton1, RadioButton1.DataType), Empty If Not UpdateOmitIfEmpty("SDIP") Or IsDef_SDIP Then Cmd.AddSQLStrings "SDIP=" & Connection.ToSQL(SDIP, SDIP.DataType), Empty If Not UpdateOmitIfEmpty("Hidden1") Or IsDef_Hidden1 Then Cmd.AddSQLStrings "recdate=" & Connection.ToSQL(Hidden1, Hidden1.DataType), Empty CmdExecution = Cmd.PrepareSQL("Update", "info", Where) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteUpdate", Me) If Errors.Count = 0 And CmdExecution Then Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteUpdate", Me) End If End Sub 'End Update Method 'Insert Method @2-ACEFDB80 Sub Insert(Cmd) CmdExecution = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildInsert", Me) Set Cmd.Connection = Connection Cmd.CommandOperation = cmdExec Cmd.CommandType = dsTable Cmd.CommandParameters = Empty Dim IsDef_fname : IsDef_fname = CCIsDefined("fname", "Form") Dim IsDef_lname : IsDef_lname = CCIsDefined("lname", "Form") Dim IsDef_address : IsDef_address = CCIsDefined("address", "Form") Dim IsDef_city : IsDef_city = CCIsDefined("city", "Form") Dim IsDef_st : IsDef_st = CCIsDefined("st", "Form") Dim IsDef_zip : IsDef_zip = CCIsDefined("zip", "Form") Dim IsDef_dtel : IsDef_dtel = CCIsDefined("dtel", "Form") Dim IsDef_wtel : IsDef_wtel = CCIsDefined("wtel", "Form") Dim IsDef_mtel : IsDef_mtel = CCIsDefined("mtel", "Form") Dim IsDef_email : IsDef_email = CCIsDefined("email", "Form") Dim IsDef_contime : IsDef_contime = CCIsDefined("contime", "Form") Dim IsDef_dob : IsDef_dob = CCIsDefined("dob", "Form") Dim IsDef_yrsdrive : IsDef_yrsdrive = CCIsDefined("yrsdrive", "Form") Dim IsDef_gend : IsDef_gend = CCIsDefined("gend", "Form") Dim IsDef_drivnum : IsDef_drivnum = CCIsDefined("drivnum", "Form") Dim IsDef_licst : IsDef_licst = CCIsDefined("licst", "Form") Dim IsDef_driveed : IsDef_driveed = CCIsDefined("driveed", "Form") Dim IsDef_RadioButton1 : IsDef_RadioButton1 = CCIsDefined("RadioButton1", "Form") Dim IsDef_SDIP : IsDef_SDIP = CCIsDefined("SDIP", "Form") Dim IsDef_Hidden1 : IsDef_Hidden1 = CCIsDefined("Hidden1", "Form") If Not InsertOmitIfEmpty("fname") Or IsDef_fname Then Cmd.AddSQLStrings "fname", Connection.ToSQL(fname, fname.DataType) If Not InsertOmitIfEmpty("lname") Or IsDef_lname Then Cmd.AddSQLStrings "lname", Connection.ToSQL(lname, lname.DataType) If Not InsertOmitIfEmpty("address") Or IsDef_address Then Cmd.AddSQLStrings "address", Connection.ToSQL(address, address.DataType) If Not InsertOmitIfEmpty("city") Or IsDef_city Then Cmd.AddSQLStrings "city", Connection.ToSQL(city, city.DataType) If Not InsertOmitIfEmpty("st") Or IsDef_st Then Cmd.AddSQLStrings "st", Connection.ToSQL(st, st.DataType) If Not InsertOmitIfEmpty("zip") Or IsDef_zip Then Cmd.AddSQLStrings "zip", Connection.ToSQL(zip, zip.DataType) If Not InsertOmitIfEmpty("dtel") Or IsDef_dtel Then Cmd.AddSQLStrings "dtel", Connection.ToSQL(dtel, dtel.DataType) If Not InsertOmitIfEmpty("wtel") Or IsDef_wtel Then Cmd.AddSQLStrings "wtel", Connection.ToSQL(wtel, wtel.DataType) If Not InsertOmitIfEmpty("mtel") Or IsDef_mtel Then Cmd.AddSQLStrings "mtel", Connection.ToSQL(mtel, mtel.DataType) If Not InsertOmitIfEmpty("email") Or IsDef_email Then Cmd.AddSQLStrings "email", Connection.ToSQL(email, email.DataType) If Not InsertOmitIfEmpty("contime") Or IsDef_contime Then Cmd.AddSQLStrings "contime", Connection.ToSQL(contime, contime.DataType) If Not InsertOmitIfEmpty("dob") Or IsDef_dob Then Cmd.AddSQLStrings "dob", Connection.ToSQL(dob, dob.DataType) If Not InsertOmitIfEmpty("yrsdrive") Or IsDef_yrsdrive Then Cmd.AddSQLStrings "yrsdrive", Connection.ToSQL(yrsdrive, yrsdrive.DataType) If Not InsertOmitIfEmpty("gend") Or IsDef_gend Then Cmd.AddSQLStrings "gend", Connection.ToSQL(gend, gend.DataType) If Not InsertOmitIfEmpty("drivnum") Or IsDef_drivnum Then Cmd.AddSQLStrings "drivnum", Connection.ToSQL(drivnum, drivnum.DataType) If Not InsertOmitIfEmpty("licst") Or IsDef_licst Then Cmd.AddSQLStrings "licst", Connection.ToSQL(licst, licst.DataType) If Not InsertOmitIfEmpty("driveed") Or IsDef_driveed Then Cmd.AddSQLStrings "driveed", Connection.ToSQL(driveed, driveed.DataType) If Not InsertOmitIfEmpty("RadioButton1") Or IsDef_RadioButton1 Then Cmd.AddSQLStrings "triplea", Connection.ToSQL(RadioButton1, RadioButton1.DataType) If Not InsertOmitIfEmpty("SDIP") Or IsDef_SDIP Then Cmd.AddSQLStrings "SDIP", Connection.ToSQL(SDIP, SDIP.DataType) If Not InsertOmitIfEmpty("Hidden1") Or IsDef_Hidden1 Then Cmd.AddSQLStrings "recdate", Connection.ToSQL(Hidden1, Hidden1.DataType) CmdExecution = Cmd.PrepareSQL("Insert", "info", Empty) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteInsert", Me) If Errors.Count = 0 And CmdExecution Then Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteInsert", Me) End If End Sub 'End Insert Method End Class 'End infoDataSource Class @2-A61BA892 %>