-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathULAlienacao.pas
49 lines (38 loc) · 967 Bytes
/
ULAlienacao.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
unit ULAlienacao;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ULGenerico, FMTBcd, DB, SqlExpr, Provider, DBClient, StdCtrls, Grids,
DBGrids, Buttons, PngBitBtn, ExtCtrls;
type
TfrmLAlienacao = class(TfrmLGenerico)
Label1: TLabel;
txtLocaliza: TEdit;
cdsTabALIENACAO: TStringField;
procedure MontaSQL;
procedure btConsultarClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmLAlienacao: TfrmLAlienacao;
implementation
uses UFuncoes;
{$R *.dfm}
{ TfrmLGenerico1 }
procedure TfrmLAlienacao.btConsultarClick(Sender: TObject);
begin
MontaSQL;
inherited;
end;
procedure TfrmLAlienacao.MontaSQL;
begin
sql := 'SELECT * FROM ALIENACAO';
if not Vazio(txtLocaliza.Text) then begin
sql := sql + ' WHERE ALIENACAO LIKE %' +QuotedStr(txtLocaliza.Text)+'%';
end;
sql := sql + ' ORDER BY ALIENACAO';
end;
end.