object Form1: TForm1 Left = 248 Height = 575 Top = 397 Width = 1026 Caption = 'Employee List' ClientHeight = 575 ClientWidth = 1026 OnClose = FormClose OnShow = FormShow LCLVersion = '1.4.0.2' object Button1: TButton Left = 939 Height = 25 Top = 48 Width = 75 Action = AddEmployee Anchors = [akTop, akRight] TabOrder = 0 end object Button3: TButton Left = 939 Height = 25 Top = 80 Width = 75 Action = DeleteEmployee Anchors = [akTop, akRight] TabOrder = 1 end object Label1: TLabel Left = 17 Height = 15 Top = 14 Width = 87 Caption = 'Started Before' ParentColor = False end object BeforeDate: TDateEdit Left = 112 Height = 25 Top = 8 Width = 80 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] OKCaption = 'OK' CancelCaption = 'Cancel' DateOrder = doNone ButtonWidth = 23 NumGlyphs = 1 MaxLength = 0 OnChange = BeforeDateChange TabOrder = 2 end object Label2: TLabel Left = 241 Height = 15 Top = 14 Width = 78 Caption = 'Started After' ParentColor = False end object AfterDate: TDateEdit Left = 333 Height = 25 Top = 8 Width = 80 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] OKCaption = 'OK' CancelCaption = 'Cancel' DateOrder = doNone ButtonWidth = 23 NumGlyphs = 1 MaxLength = 0 OnChange = BeforeDateChange TabOrder = 3 end object Panel1: TPanel Left = 12 Height = 527 Top = 42 Width = 904 Anchors = [akTop, akLeft, akRight, akBottom] BevelOuter = bvNone ClientHeight = 527 ClientWidth = 904 ParentColor = False TabOrder = 4 object DBControlGrid1: TDBControlGrid Left = 0 Height = 477 Top = 0 Width = 904 Align = alClient AlternateColor = clSkyBlue AltColorStartNormal = True Color = clWhite DataSource = EmployeeSource DefaultRowHeight = 80 DefaultPositionAtEnd = False DrawPanel = EmployeeEditorPanel Options = [dgpIndicator] TabOrder = 1 ColWidths = ( 12 890 ) object EmployeeEditorPanel: TPanel Left = 12 Height = 80 Top = 0 Width = 890 Anchors = [] BevelOuter = bvNone BorderWidth = 2 BorderStyle = bsSingle ClientHeight = 78 ClientWidth = 888 Color = clWhite ParentColor = False TabOrder = 0 Visible = False object Label3: TLabel Left = 0 Height = 15 Top = 7 Width = 83 Caption = 'Employee No.' ParentColor = False end object DBEdit1: TDBEdit Left = 90 Height = 25 Top = 2 Width = 120 DataField = 'EMP_NO' DataSource = EmployeeSource CharCase = ecNormal MaxLength = 0 TabOrder = 0 end object Label4: TLabel Left = 12 Height = 15 Top = 32 Width = 64 Caption = 'First Name' ParentColor = False end object DBEdit2: TDBEdit Left = 90 Height = 25 Top = 24 Width = 120 DataField = 'FIRST_NAME' DataSource = EmployeeSource CharCase = ecNormal MaxLength = 0 TabOrder = 1 end object Label5: TLabel Left = 12 Height = 15 Top = 56 Width = 64 Caption = 'Last Name' ParentColor = False end object DBEdit3: TDBEdit Left = 90 Height = 25 Top = 46 Width = 120 DataField = 'LAST_NAME' DataSource = EmployeeSource CharCase = ecNormal MaxLength = 0 TabOrder = 2 end object Label6: TLabel Left = 216 Height = 15 Top = 7 Width = 77 Caption = 'Date Started' ParentColor = False end object IBDateEdit1: TDBDateEdit Left = 300 Height = 25 Top = 2 Width = 80 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] OKCaption = 'OK' CancelCaption = 'Cancel' DateOrder = doNone ButtonWidth = 23 AutoSelect = False NumGlyphs = 1 MaxLength = 0 TabOrder = 3 DataField = 'HIRE_DATE' DataSource = EmployeeSource end object Label7: TLabel Left = 252 Height = 15 Top = 32 Width = 37 Caption = 'Salary' ParentColor = False end object DBEdit4: TDBEdit Left = 300 Height = 25 Top = 24 Width = 104 DataField = 'SALARY' DataSource = EmployeeSource CharCase = ecNormal MaxLength = 0 TabOrder = 5 end object Label8: TLabel Left = 814 Height = 15 Top = 54 Width = 24 Anchors = [akTop, akRight] Caption = 'Ext.' ParentColor = False end object DBEdit5: TDBEdit Left = 838 Height = 25 Top = 48 Width = 40 DataField = 'PHONE_EXT' DataSource = EmployeeSource Anchors = [akTop, akRight] CharCase = ecNormal MaxLength = 0 TabOrder = 4 end object Label9: TLabel Left = 536 Height = 15 Top = 7 Width = 51 Caption = 'Location' ParentColor = False end object Label10: TLabel Left = 413 Height = 15 Top = 9 Width = 59 Caption = 'Job Grade' ParentColor = False end object JobGradeDBComboBox: TDBComboBox Left = 480 Height = 25 Top = 2 Width = 48 AutoSize = False DataField = 'JOB_GRADE' DataSource = EmployeeSource ItemHeight = 0 Items.Strings = ( '1' '2' '3' '4' '5' ) MaxLength = 0 OnCloseUp = JobGradeDBComboBoxCloseUp Style = csDropDownList TabOrder = 6 end object Label11: TLabel Left = 536 Height = 15 Top = 32 Width = 48 Caption = 'Job Title' ParentColor = False end object Label12: TLabel Left = 256 Height = 15 Top = 54 Width = 33 Caption = 'Dept.' ParentColor = False end object SpeedButton1: TSpeedButton Left = 786 Height = 25 Top = 48 Width = 23 Action = SelectDept Anchors = [akTop, akRight] end object DBEdit6: TDBEdit Left = 300 Height = 25 Top = 48 Width = 478 DataField = 'DEPT_PATH' DataSource = EmployeeSource ReadOnly = True Anchors = [akTop, akLeft, akRight] CharCase = ecNormal MaxLength = 0 TabOrder = 7 end object DBEdit7: TDBEdit Left = 592 Height = 25 Top = 0 Width = 246 DataField = 'JOB_COUNTRY' DataSource = EmployeeSource ReadOnly = True CharCase = ecNormal MaxLength = 0 TabOrder = 8 end object DBEdit8: TDBEdit Left = 592 Height = 25 Top = 24 Width = 246 DataField = 'JOB_TITLE' DataSource = EmployeeSource CharCase = ecNormal MaxLength = 0 TabOrder = 9 end object SpeedButton2: TSpeedButton Left = 847 Height = 22 Top = 0 Width = 23 Action = EditLocationAction end object SpeedButton3: TSpeedButton Left = 847 Height = 22 Top = 24 Width = 23 Action = EditJobCodeAction end end end object Panel2: TPanel Left = 0 Height = 50 Top = 477 Width = 904 Align = alBottom BevelOuter = bvNone ClientHeight = 50 ClientWidth = 904 ParentColor = False TabOrder = 0 object Button5: TButton Left = 80 Height = 25 Top = 16 Width = 75 Action = CancelChanges Anchors = [akLeft, akBottom] TabOrder = 0 end object Button4: TButton Left = 1 Height = 25 Top = 16 Width = 75 Action = SaveChanges Anchors = [akLeft, akBottom] TabOrder = 1 end object DBText1: TDBText Left = 832 Height = 27 Top = 16 Width = 49 Alignment = taRightJustify Anchors = [akTop, akRight, akBottom] DataField = 'TOTALSALARIES' DataSource = TotalsSource ParentColor = False end end end object Label13: TLabel Left = 456 Height = 15 Top = 14 Width = 79 Caption = 'Salary Range' ParentColor = False end object SalaryRange: TComboBox Left = 544 Height = 25 Top = 8 Width = 272 ItemHeight = 0 ItemIndex = 0 Items.Strings = ( 'None Specified' 'Below $40,000' 'Between $40,000 and $100,000' 'Above $100,000' ) OnCloseUp = BeforeDateChange Style = csDropDownList TabOrder = 5 Text = 'None Specified' end object IBDatabase1: TIBDatabase Connected = False AllowStreamedConnected = False DatabaseName = 'employee' Params.Strings = ( 'user_name=SYSDBA' 'lc_ctype=UTF-8' ) DefaultTransaction = IBTransaction1 IdleTimer = 0 SQLHourGlass = False TraceFlags = [] left = 832 top = 168 end object IBTransaction1: TIBTransaction Active = False DefaultDatabase = IBDatabase1 Params.Strings = ( 'read_committed' 'rec_version' 'nowait' ) left = 872 top = 168 end object EmployeeSource: TDataSource DataSet = Employees left = 832 top = 336 end object ActionList1: TActionList left = 832 top = 416 object AddEmployee: TAction Caption = 'Add' OnExecute = AddEmployeeExecute end object EditEmployee: TAction Caption = 'Edit' OnUpdate = EditEmployeeUpdate end object DeleteEmployee: TAction Caption = 'Delete' OnExecute = DeleteEmployeeExecute OnUpdate = EditEmployeeUpdate end object SaveChanges: TAction Caption = 'Save' OnExecute = SaveChangesExecute OnUpdate = SaveChangesUpdate end object CancelChanges: TAction Caption = 'Cancel' OnExecute = CancelChangesExecute OnUpdate = SaveChangesUpdate end object SelectDept: TAction Caption = '...' OnExecute = SelectDeptExecute end object EditJobCodeAction: TAction Caption = '...' OnExecute = EditJobCodeActionExecute OnUpdate = EditJobCodeActionUpdate end object EditLocationAction: TAction Caption = '...' OnExecute = EditLocationActionExecute OnUpdate = EditJobCodeActionUpdate end end object TotalsQuery: TIBQuery Database = IBDatabase1 Transaction = IBTransaction1 BeforeOpen = EmployeesBeforeOpen BufferChunks = 1000 CachedUpdates = False GenerateParamNames = False GeneratorField.ApplyOnEvent = gaeOnNewRecord SQL.Strings = ( 'Select sum(Salary) as TotalSalaries' 'From EMPLOYEE' ) Params = <> left = 872 top = 376 object TotalsQueryTOTALSALARIES: TIBBCDField DisplayWidth = 18 FieldKind = fkData FieldName = 'TOTALSALARIES' Index = 0 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = False OnGetText = TotalsQueryTOTALSALARIESGetText Precision = 18 Currency = False MaxValue = 0 MinValue = 0 Size = 2 end end object TotalsSource: TDataSource DataSet = TotalsQuery left = 832 top = 376 end object Employees: TIBDataSet Database = IBDatabase1 Transaction = IBTransaction1 AfterDelete = EmployeesAfterDelete AfterEdit = EmployeesAfterDelete AfterInsert = EmployeesAfterInsert AfterOpen = EmployeesAfterOpen AfterPost = EmployeesAfterPost BeforeClose = EmployeesBeforeClose BeforeOpen = EmployeesBeforeOpen BufferChunks = 1000 CachedUpdates = False DeleteSQL.Strings = ( 'Delete From EMPLOYEE A' 'Where A.EMP_NO = :EMP_NO' ) InsertSQL.Strings = ( 'Insert Into EMPLOYEE(EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY)' 'Values(:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY, :SALARY)' ) RefreshSQL.Strings = ( 'with recursive Depts As (' 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,' 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH' 'From DEPARTMENT Where HEAD_DEPT is NULL ' 'UNION ALL' 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,' 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH' 'From DEPARTMENT ' 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO' ')' '' 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, ' 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE' 'From EMPLOYEE A' 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO' 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE' 'Where A.EMP_NO = :EMP_NO' ) SelectSQL.Strings = ( 'with recursive Depts As (' 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,' 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH' 'From DEPARTMENT Where HEAD_DEPT is NULL ' 'UNION ALL' 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,' 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH' 'From DEPARTMENT ' 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO' ')' '' 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, ' 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE' 'From EMPLOYEE A' 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO' 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE' 'Order by A.LAST_NAME' ) ModifySQL.Strings = ( 'Update EMPLOYEE A Set '#13#10' A.DEPT_NO = :DEPT_NO,'#13#10' A.FIRST_NAME = :FIRST_NAME,'#13#10' A.HIRE_DATE = :HIRE_DATE,'#13#10' A.JOB_CODE = :JOB_CODE,'#13#10' A.JOB_COUNTRY = :JOB_COUNTRY,'#13#10' A.JOB_GRADE = :JOB_GRADE,'#13#10' A.LAST_NAME = :LAST_NAME,'#13#10' A.PHONE_EXT = :PHONE_EXT,'#13#10' A.SALARY = :SALARY' 'Where A.EMP_NO = :OLD_EMP_NO' ) GeneratorField.Generator = 'EMP_NO_GEN' GeneratorField.Field = 'EMP_NO' GeneratorField.ApplyOnEvent = gaeOnNewRecord GenerateParamNames = False AfterTransactionEnd = EmployeesAfterTransactionEnd left = 872 top = 336 object EmployeesEMP_NO: TSmallintField DisplayWidth = 10 FieldKind = fkData FieldName = 'EMP_NO' Index = 0 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True end object EmployeesFIRST_NAME: TIBStringField DisplayWidth = 15 FieldKind = fkData FieldName = 'FIRST_NAME' Index = 1 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 15 end object EmployeesLAST_NAME: TIBStringField DisplayWidth = 20 FieldKind = fkData FieldName = 'LAST_NAME' Index = 2 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True end object EmployeesPHONE_EXT: TIBStringField Alignment = taRightJustify DisplayWidth = 4 FieldKind = fkData FieldName = 'PHONE_EXT' Index = 3 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = False Size = 4 end object EmployeesHIRE_DATE: TDateTimeField DisplayWidth = 10 FieldKind = fkData FieldName = 'HIRE_DATE' Index = 4 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True end object EmployeesDEPT_NO: TIBStringField DisplayWidth = 3 FieldKind = fkData FieldName = 'DEPT_NO' Index = 5 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 3 end object EmployeesJOB_CODE: TIBStringField DisplayWidth = 5 FieldKind = fkData FieldName = 'JOB_CODE' Index = 6 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 5 end object EmployeesJOB_GRADE: TSmallintField DisplayWidth = 10 FieldKind = fkData FieldName = 'JOB_GRADE' Index = 7 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True end object EmployeesJOB_COUNTRY: TIBStringField DisplayWidth = 15 FieldKind = fkData FieldName = 'JOB_COUNTRY' Index = 8 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 15 end object EmployeesSALARY: TIBBCDField DisplayWidth = 18 FieldKind = fkData FieldName = 'SALARY' Index = 9 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True OnGetText = EmployeesSALARYGetText Precision = 18 Currency = False MaxValue = 0 MinValue = 0 Size = 2 end object EmployeesFULL_NAME: TIBStringField DisplayWidth = 37 FieldKind = fkData FieldName = 'FULL_NAME' Index = 10 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = True Required = False Size = 37 end object EmployeesDEPT_PATH: TIBStringField DisplayWidth = 256 FieldKind = fkData FieldName = 'DEPT_PATH' Index = 11 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 256 end object EmployeesDEPT_KEY_PATH: TIBStringField DisplayWidth = 64 FieldKind = fkData FieldName = 'DEPT_KEY_PATH' Index = 12 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 64 end object EmployeesJOB_TITLE: TIBStringField DisplayWidth = 25 FieldKind = fkData FieldName = 'JOB_TITLE' Index = 13 LookupCache = False ProviderFlags = [pfInUpdate, pfInWhere] ReadOnly = False Required = True Size = 25 end end end