-
Notifications
You must be signed in to change notification settings - Fork 2
/
CollectionUnit.pas
executable file
·66 lines (54 loc) · 1.49 KB
/
CollectionUnit.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
unit CollectionUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TntForms, Grids, DBGrids, TntDBGrids, StdCtrls, Buttons,
TntButtons, TntStdCtrls;
type
TCollectionForm = class(TTntForm)
TntDBGrid1: TTntDBGrid;
TntBitBtn1: TTntBitBtn;
TntBitBtn2: TTntBitBtn;
TntBitBtn6: TTntBitBtn;
procedure TntBitBtn1Click(Sender: TObject);
procedure TntDBGrid1DblClick(Sender: TObject);
procedure TntBitBtn6Click(Sender: TObject);
procedure TntFormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CollectionForm: TCollectionForm;
implementation
uses common, DataUnit, DB, GlobalProcedures, NewCollectionUnit;
{$R *.DFM}
procedure TCollectionForm.TntBitBtn1Click(Sender: TObject);
begin
data.collection.Append;
NewCollectionForm.ShowModal;
end;
procedure TCollectionForm.TntDBGrid1DblClick(Sender: TObject);
begin
if not Data.collection.IsEmpty Then
begin
EditTable(data.collection);
NewCollectionForm.ShowModal;
end;
end;
procedure TCollectionForm.TntBitBtn6Click(Sender: TObject);
begin
if data.collection.IsEmpty = false then
if MessYesNo('Are you sure?') then
begin
data.collection.Delete;
data.collection.Refresh;
end;
end;
procedure TCollectionForm.TntFormActivate(Sender: TObject);
begin
data.collection.Refresh;
data.branch.Refresh;
end;
end.