-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEquipamentosSetorSensor.pas
96 lines (84 loc) · 2.37 KB
/
EquipamentosSetorSensor.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
unit EquipamentosSetorSensor;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Connection, Data.DB, Vcl.StdCtrls,
Vcl.DBCtrls, Vcl.ExtCtrls, Vcl.Mask, Vcl.Grids, Vcl.DBGrids, Vcl.Buttons;
type
TCadEquip = class(TForm)
dtsSensor: TDataSource;
DBLCBSetor: TDBLookupComboBox;
dtsEquip: TDataSource;
DBGrid1: TDBGrid;
EdtDesc: TDBEdit;
edtEspec: TDBMemo;
Panel1: TPanel;
DBNavigator1: TDBNavigator;
edtQTDE: TDBEdit;
EdtCodigo: TDBEdit;
dstTipoEquip: TDataSource;
DBLCBTipoEquip: TDBLookupComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Panel2: TPanel;
Navegação: TLabel;
Panel3: TPanel;
edtPesquisa: TEdit;
RBTipo: TRadioButton;
RBSetor: TRadioButton;
RBDesc: TRadioButton;
btnPesquisa: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure btnPesquisaClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CadEquip: TCadEquip;
implementation
{$R *.dfm}
procedure TCadEquip.btnPesquisaClick(Sender: TObject);
begin
if RBTipo.Checked then
begin
DT_connection.qryEquip.Close;
DT_connection.qryEquip.SQL.Clear;
DT_connection.qryEquip.SQL.Add
('Select * from '+
' EquipamentosSetor where TipoEquipamento_idTipoEquipamento like '+QuotedStr('%'+edtPesquisa.Text+'%'));
DT_connection.qryEquip.Open;
end;
if RBSetor.Checked then
begin
DT_connection.qryEquip.Close;
DT_connection.qryEquip.SQL.Clear;
DT_connection.qryEquip.SQL.Add
('Select * from '+
' EquipamentosSetor where Sensor_SensorID like '+QuotedStr('%'+edtPesquisa.Text+'%'));
DT_connection.qryEquip.Open;
end;
if RBDesc.Checked then
begin
DT_connection.qryEquip.Close;
DT_connection.qryEquip.SQL.Clear;
DT_connection.qryEquip.SQL.Add
('Select * from '+
' EquipamentosSetor where DescricaoEquip like '+QuotedStr('%'+edtPesquisa.Text+'%'));
DT_connection.qryEquip.Open;
end;
end;
procedure TCadEquip.FormCreate(Sender: TObject);
begin
DT_connection.FDcon.Connected := true;
DT_connection.qrySensor2.active := true;
DT_connection.qryEquip.active := true;
DT_connection.qryTipoEquip.active := true;
end;
end.