-
Notifications
You must be signed in to change notification settings - Fork 0
/
UKwatSprzetRTV.pas
133 lines (112 loc) · 3.23 KB
/
UKwatSprzetRTV.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
unit UKwatSprzetRTV;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
ComCtrls, TplGradientUnit, datamodule, ZDataset, DB, rxdbgrid;
type
{ TKwatSprzetRTV }
TKwatSprzetRTV = class(TForm)
DSpocCela: TDataSource;
DSOsMagazyn: TDataSource;
DSOsCela: TDataSource;
DSpocMagazyn: TDataSource;
DSOsWydane: TDataSource;
DSpocWydane: TDataSource;
GroupBox1: TGroupBox;
Image1: TImage;
lblWCeli: TLabel;
lblKlasyf: TLabel;
lblNaglowek: TLabel;
lblNazwisko: TLabel;
lblPoc: TLabel;
PageControl1: TPageControl;
PageControl2: TPageControl;
Panel1: TPanel;
Panel2: TPanel;
Panel5: TPanel;
plGradient2: TplGradient;
RxDBGrid1: TRxDBGrid;
RxDBGrid2: TRxDBGrid;
RxDBGrid3: TRxDBGrid;
RxDBGrid4: TRxDBGrid;
RxDBGrid5: TRxDBGrid;
RxDBGrid6: TRxDBGrid;
Splitter1: TSplitter;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
ZQpocCela: TZReadOnlyQuery;
ZQOsMagazyn: TZReadOnlyQuery;
ZQOsCela: TZReadOnlyQuery;
ZQpocMagazyn: TZReadOnlyQuery;
ZQOsWydane: TZReadOnlyQuery;
ZQpocWydane: TZReadOnlyQuery;
private
SelectIDO: integer;
SelectPOC: string;
procedure WczytajDaneOsadzonego;
public
constructor Create(TheOwner: TComponent; IDO: integer); overload;
end;
implementation
{$R *.frm}
{ TKwatSprzetRTV }
constructor TKwatSprzetRTV.Create(TheOwner: TComponent; IDO: integer);
begin
Inherited Create(TheOwner);
SelectIDO:= IDO;
ShowSQLWait;
try
WczytajDaneOsadzonego;
ZQOsMagazyn.Close;
ZQOsMagazyn.ParamByName('ido').AsInteger:= SelectIDO;
ZQOsMagazyn.Open;
ZQOsCela.Close;
ZQOsCela.ParamByName('ido').AsInteger := SelectIDO;
ZQOsCela.Open;
ZQOsWydane.Close;
ZQOsWydane.ParamByName('ido').AsInteger := SelectIDO;
ZQOsWydane.Open;
TabSheet2.Show;
// ==================== cała cela =====================
ZQpocMagazyn.Close;
ZQpocMagazyn.ParamByName('poc').AsString:= SelectPOC;
ZQpocMagazyn.Open;
ZQpocCela.Close;
ZQpocCela.ParamByName('poc').AsString := SelectPOC;
ZQpocCela.Open;
ZQpocWydane.Close;
ZQpocWydane.ParamByName('poc').AsString := SelectPOC;
ZQpocWydane.Open;
TabSheet5.Show;
finally
HideSQLWait;
end;
end;
procedure TKwatSprzetRTV.WczytajDaneOsadzonego;
var ZQPom: TZQueryPom;
begin
ZQPom:= TZQueryPom.Create(Self);
try
ZQPom.SQL.Text:= 'SELECT IDO, Nazwisko, Imie, Ojciec, POC, Klasyf FROM osadzeni WHERE IDO = :ido';
ZQPom.ParamByName('ido').AsInteger:= SelectIDO;
ZQPom.Open;
if not ZQPom.IsEmpty then
begin
lblNazwisko.Caption:= ZQPom.FieldByName('Nazwisko').AsString+ ' ' + ZQPom.FieldByName('Imie').AsString + ' s.'+ ZQPom.FieldByName('Ojciec').AsString;
lblKlasyf.Caption := ZQPom.FieldByName('Klasyf').AsString;
SelectPOC := ZQPom.FieldByName('POC').AsString;
lblPoc.Caption := SelectPOC;
lblWCeli.Caption := lblWCeli.Caption + ' : ' + SelectPOC;
end
else
lblNazwisko.Caption:= 'Brak danych osadzonego';
finally
FreeAndNil(ZQPom);
end;
end;
end.