/
UConsForn.~pas
107 lines (94 loc) · 2.97 KB
/
UConsForn.~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
97
98
99
100
101
102
103
104
105
106
107
unit UConsForn;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, CustomCellSource, DataCellSource, GridPrint, ScrollView,
CustomGridViewControl, CustomGridView, GridView, DB, IBCustomDataSet,
IBQuery, StdCtrls, Buttons, ExtCtrls;
type
TConsForn = class(TForm)
Panel1: TPanel;
GroupBox2: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
GroupBox3: TGroupBox;
SpeedButton1: TSpeedButton;
Edit1: TEdit;
Panel2: TPanel;
IBQuery1: TIBQuery;
DataSource1: TDataSource;
RadioButton12: TRadioButton;
GridView1: TGridView;
GridPrint1: TGridPrint;
DataCellSource1: TDataCellSource;
procedure SpeedButton1Click(Sender: TObject);
procedure GridView1SelectCell(Sender: TObject; ACol, ARow: Integer);
procedure GridView1DblClick(Sender: TObject);
private
{ Private declarations }
public
function InsertCodRet(const ret :Integer):Boolean;
end;
var
ConsForn: TConsForn;
CodRet: Integer;
codcli: Integer;
implementation
uses Unit1, Unit10, Unit8;
{$R *.dfm}
function TConsForn.InsertCodRet(const ret :Integer):Boolean;
begin
CodRet := ret;
end;
procedure TConsForn.SpeedButton1Click(Sender: TObject);
begin
IBQuery1.Active := fALSE;
IBQuery1.SQL.Clear;
IBQuery1.SQL.Add('select * from CLIENTES_FORNECEDOR WHERE cod_part >0');
IF(RadioButton1.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND NOME LIKE ''%'+eDIT1.Text+'%''');
IF(RadioButton2.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND CPF LIKE ''%'+eDIT1.Text+'%''');
IF(RadioButton3.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND IE LIKE ''%'+eDIT1.Text+'%''');
IF(RadioButton4.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND TPPESSOA = ''%'+eDIT1.Text+'%''');
IF(RadioButton5.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND REPRESENTANTE = '+eDIT1.Text);
IF(RadioButton6.Checked = tRUE)THEN
IBQuery1.SQL.Add('AND RAMO_ATIVIDADE = '+eDIT1.Text);
IF(RadioButton12.Checked = tRUE)THEN
IBQuery1.SQL.Add(' ');
sHOWmeSSAGE(IBQuery1.SQL.TEXT);
IBQuery1.Active := tRUE;
while( not IBQuery1.Eof)do
begin
DataCellSource1.Active := True;
IBQuery1.next;
end;
end;
procedure TConsForn.GridView1SelectCell(Sender: TObject; ACol,
ARow: Integer);
begin
if (CodRet = 1)then
codcli := GridView1.Cell[0,ARow].AsInteger;
if (CodRet = 2)then
codcli := GridView1.Cell[0,ARow].AsInteger;
end;
procedure TConsForn.GridView1DblClick(Sender: TObject);
begin
Form7.txtfornecedor.Text := IntToStr(codcli);
ConsForn.close;
end;
end.
{
if(GridView1.Cell[29,ARow].AsBoolean = false )then
soma := soma + GridView1.Cell[09,ARow].AsFloat;
if(GridView1.Cell[29,ARow].AsBoolean = True )then
soma := soma - GridView1.Cell[09,ARow].AsFloat;
Label1.Caption := FloatToStr(soma);
}