-
Notifications
You must be signed in to change notification settings - Fork 0
/
uprincipal.pas
58 lines (48 loc) · 1.32 KB
/
uprincipal.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
50
51
52
53
54
55
56
57
58
unit uprincipal;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TfrmPrincipal = class(TForm)
edtRetornoPesquisa: TEdit;
Label1: TLabel;
btnCliente: TButton;
btnFornecedor: TButton;
procedure btnClienteClick(Sender: TObject);
procedure btnFornecedorClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmPrincipal: TfrmPrincipal;
implementation
uses upesquisa;
{$R *.dfm}
procedure TfrmPrincipal.btnClienteClick(Sender: TObject);
begin
frmPesquisa := tfrmPesquisa.Create(self,['codigo','nome','telefone'],'cliente','nome');
try
if frmPesquisa.ShowModal = mrYes then
edtRetornoPesquisa.Text := frmPesquisa.edtRetorno.Text
else
edtRetornoPesquisa.Clear;
finally
FreeAndNil(frmPesquisa);
end;
end;
procedure TfrmPrincipal.btnFornecedorClick(Sender: TObject);
begin
frmPesquisa := tfrmPesquisa.Create(self,['codigo','nome','endereco','numero'],'fornecedor','nome');
try
if frmPesquisa.ShowModal = mrYes then
edtRetornoPesquisa.Text := frmPesquisa.edtRetorno.Text
else
edtRetornoPesquisa.Clear;
finally
FreeAndNil(frmPesquisa);
end;
end;
end.