<%@ CodePage=1252 %> <% 'Include Common Files @1-C42A9701 %> <% 'End Include Common Files 'Initialize Page @1-8B26E852 ' 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 = "Home1.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "Home1.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-6B0901AD 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-66ADECD6 ' 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 TextBox1 Dim TextBox2 Dim ListBox1 Dim TextBox3 Dim Button1 Dim Button_Insert 'End info Variables 'info Class_Initialize Event @2-59A3EDD4 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) st.BoundColumn = "st" st.TextColumn = "st_name" Set st.DataSource = CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _ "FROM st_name {SQL_Where} {SQL_OrderBy}", "", "")) 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", "Day & Night"), _ Array("Day", "Night", "Day & Night"))) contime.HTML = True Set TextBox1 = CCCreateControl(ccsTextBox, "TextBox1", Empty, ccsText, Empty, CCGetRequestParam("TextBox1", Method)) Set TextBox2 = CCCreateControl(ccsTextBox, "TextBox2", Empty, ccsText, Empty, CCGetRequestParam("TextBox2", Method)) Set ListBox1 = CCCreateList(ccsListBox, "ListBox1", Empty, ccsText, CCGetRequestParam("ListBox1", Method), Empty) ListBox1.BoundColumn = "st" ListBox1.TextColumn = "st_name" Set ListBox1.DataSource = CCCreateDataSource(dsTable,DBConnection1, Array("SELECT * " & _ "FROM st_name {SQL_Where} {SQL_OrderBy}", "", "")) Set TextBox3 = CCCreateControl(ccsTextBox, "TextBox3", Empty, ccsText, Empty, CCGetRequestParam("TextBox3", Method)) Set Button1 = CCCreateButton("Button1", 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, TextBox1, TextBox2, ListBox1, TextBox3) If Not FormSubmitted Then If IsEmpty(st.Value) Then _ st.Value = "Massachusetts" End If End Sub 'End info Class_Initialize Event 'info Initialize Method @2-A94E0546 Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection With DataSource .Parameters("sesemail") = Session("email") 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-EDFEEA9A Function Validate() Dim Validation Dim Where If EditMode Then DataSource.BuildTableWhere If DataSource.Where <> "" Then _ Where = " AND NOT (" & DataSource.Where & ")" End If If email.Errors.Count = 0 Then _ If CInt(CCDLookUp("COUNT(*)", " home", "email =" & DBConnection1.ToSQL(email.Value, email.DataType) & Where, DBConnection1)) > 0 Then _ email.Errors.addError(CCSLocales.GetText("CCS_UniqueValue", Array(email.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-B7D5F29A Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = IIf(EditMode, "Button1", "Button_Insert") If Button1.Pressed Then PressedButton = "Button1" ElseIf Button_Insert.Pressed Then PressedButton = "Button_Insert" End If End If Redirect = "Home2.asp" If Validate() Then If PressedButton = "Button1" Then If NOT Button1.OnClick() OR NOT UpdateRow() Then Redirect = "" Else Redirect = "HomeConfirm.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End If ElseIf PressedButton = "Button_Insert" Then If NOT Button_Insert.OnClick() OR NOT InsertRow() Then Redirect = "" Else Redirect = "Home2.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End If End If Else Redirect = "" End If End Sub 'End info Operation Method 'info InsertRow Method @2-EDCB4D01 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.TextBox1.Value = TextBox1.Value DataSource.TextBox2.Value = TextBox2.Value DataSource.ListBox1.Value = ListBox1.Value DataSource.TextBox3.Value = TextBox3.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-DFA302B3 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.TextBox1.Value = TextBox1.Value DataSource.TextBox2.Value = TextBox2.Value DataSource.ListBox1.Value = ListBox1.Value DataSource.TextBox3.Value = TextBox3.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-2577B4AE 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, TextBox1, TextBox2, ListBox1, TextBox3, Button1, 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") TextBox1.Value = Recordset.Fields("TextBox1") TextBox2.Value = Recordset.Fields("TextBox2") ListBox1.Value = Recordset.Fields("ListBox1") TextBox3.Value = Recordset.Fields("TextBox3") 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 TextBox1.Errors Errors.AddErrors TextBox2.Errors Errors.AddErrors ListBox1.Errors Errors.AddErrors TextBox3.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 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-D0B7891D 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 TextBox1 Public TextBox2 Public ListBox1 Public TextBox3 'End DataSource Variables 'DataSource Class_Initialize Event @2-E24735D7 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", "adress", 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", "contacttime", ccsText, Empty, Recordset) Set TextBox1 = CCCreateField("TextBox1", "padress", ccsText, Empty, Recordset) Set TextBox2 = CCCreateField("TextBox2", "pcity", ccsText, Empty, Recordset) Set ListBox1 = CCCreateField("ListBox1", "pst", ccsText, Empty, Recordset) Set TextBox3 = CCCreateField("TextBox3", "pzip", ccsText, Empty, Recordset) Fields.AddFields Array(fname, lname, address, city, st, zip, dtel, _ wtel, mtel, email, contime, TextBox1, TextBox2, ListBox1, TextBox3) 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 "TextBox1", True InsertOmitIfEmpty.Add "TextBox2", True InsertOmitIfEmpty.Add "ListBox1", True InsertOmitIfEmpty.Add "TextBox3", 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 "TextBox1", True UpdateOmitIfEmpty.Add "TextBox2", True UpdateOmitIfEmpty.Add "ListBox1", True UpdateOmitIfEmpty.Add "TextBox3", True Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT TOP 1 * " & vbLf & _ "FROM home {SQL_Where} {SQL_OrderBy}" Where = "" Order = "" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @2-222F67BC 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, "sesemail", ccsText, Empty, Empty, Empty, False AllParamsSet = .AllParamsSet .Criterion(1) = .Operation(opEqual, False, "email", .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-BA8E27D9 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_TextBox1 : IsDef_TextBox1 = CCIsDefined("TextBox1", "Form") Dim IsDef_TextBox2 : IsDef_TextBox2 = CCIsDefined("TextBox2", "Form") Dim IsDef_ListBox1 : IsDef_ListBox1 = CCIsDefined("ListBox1", "Form") Dim IsDef_TextBox3 : IsDef_TextBox3 = CCIsDefined("TextBox3", "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 "adress=" & 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 "contacttime=" & Connection.ToSQL(contime, contime.DataType), Empty If Not UpdateOmitIfEmpty("TextBox1") Or IsDef_TextBox1 Then Cmd.AddSQLStrings "padress=" & Connection.ToSQL(TextBox1, TextBox1.DataType), Empty If Not UpdateOmitIfEmpty("TextBox2") Or IsDef_TextBox2 Then Cmd.AddSQLStrings "pcity=" & Connection.ToSQL(TextBox2, TextBox2.DataType), Empty If Not UpdateOmitIfEmpty("ListBox1") Or IsDef_ListBox1 Then Cmd.AddSQLStrings "pst=" & Connection.ToSQL(ListBox1, ListBox1.DataType), Empty If Not UpdateOmitIfEmpty("TextBox3") Or IsDef_TextBox3 Then Cmd.AddSQLStrings "pzip=" & Connection.ToSQL(TextBox3, TextBox3.DataType), Empty CmdExecution = Cmd.PrepareSQL("Update", "home", 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-D7F46748 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_TextBox1 : IsDef_TextBox1 = CCIsDefined("TextBox1", "Form") Dim IsDef_TextBox2 : IsDef_TextBox2 = CCIsDefined("TextBox2", "Form") Dim IsDef_ListBox1 : IsDef_ListBox1 = CCIsDefined("ListBox1", "Form") Dim IsDef_TextBox3 : IsDef_TextBox3 = CCIsDefined("TextBox3", "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 "adress", 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 "contacttime", Connection.ToSQL(contime, contime.DataType) If Not InsertOmitIfEmpty("TextBox1") Or IsDef_TextBox1 Then Cmd.AddSQLStrings "padress", Connection.ToSQL(TextBox1, TextBox1.DataType) If Not InsertOmitIfEmpty("TextBox2") Or IsDef_TextBox2 Then Cmd.AddSQLStrings "pcity", Connection.ToSQL(TextBox2, TextBox2.DataType) If Not InsertOmitIfEmpty("ListBox1") Or IsDef_ListBox1 Then Cmd.AddSQLStrings "pst", Connection.ToSQL(ListBox1, ListBox1.DataType) If Not InsertOmitIfEmpty("TextBox3") Or IsDef_TextBox3 Then Cmd.AddSQLStrings "pzip", Connection.ToSQL(TextBox3, TextBox3.DataType) CmdExecution = Cmd.PrepareSQL("Insert", "home", 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 %>