home *** CD-ROM | disk | FTP | other *** search
- unit UnitFormListCustomer;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- UnitFormListBase, ActnList, Menus, Buttons, ComCtrls, ToolWin, StdCtrls,
- ExtCtrls, UnitFrameResultSetBase, UnitFrameResultSetCustomer, ImgList;
-
- type
- TFormListCustomer = class(TFormListBase)
- FrameResultSetCustomer: TFrameResultSetCustomer;
- Label1: TLabel;
- ComboBoxCompanyName: TComboBox;
- EditCompanyName: TEdit;
- procedure EditCompanyNameChange(Sender: TObject);
- private
- { Private declarations }
- protected
- function GetFrameResultSet: TFrameResultSetBase; override;
- procedure InitializeForm; override;
- public
-
- end;
-
- implementation
-
- {$R *.DFM}
-
- { TFormListCustomer }
-
- function TFormListCustomer.GetFrameResultSet: TFrameResultSetBase;
- begin
- Result := FrameResultSetCustomer;
- end;
-
- procedure TFormListCustomer.EditCompanyNameChange(Sender: TObject);
- var s: string;
- begin
- inherited;
- case ComboBoxCompanyName.ItemIndex of
- 0: s := '(company like ''%'+EditCompanyName.Text+'%'')';
- 1: s := '(company like '''+EditCompanyName.Text+''')';
- 2: s := '(company like '''+EditCompanyName.Text+'%'')';
- else // Unexpected value -- raise an exception or show an error msg.
- end; // case
- FrameResultSetCustomer.ResultSetObject.SqlWhereClause := s;
- end;
-
- procedure TFormListCustomer.InitializeForm;
- begin
- inherited;
- ComboBoxCompanyName.ItemIndex := 0;
- end;
-
- end.
-