-
Notifications
You must be signed in to change notification settings - Fork 2
/
NewMarcUnit.pas
executable file
·100 lines (82 loc) · 2.25 KB
/
NewMarcUnit.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
unit NewMarcUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TntStdCtrls, Buttons, TntButtons, TntForms;
type
TNewMarcForm = class(TTntForm)
TntComboBox1: TTntComboBox;
TntLabel1: TTntLabel;
BitBtn1: TTntBitBtn;
BitBtn2: TTntBitBtn;
procedure BitBtn2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
NewMarcForm: TNewMarcForm;
implementation
uses DataUnit, DB, NewGroupUnit, MyAccess;
{$R *.dfm}
procedure TNewMarcForm.BitBtn2Click(Sender: TObject);
begin
NewGroupForm.ModalResult := mrNone;
close;
end;
procedure TNewMarcForm.FormActivate(Sender: TObject);
var sqltext : string;
begin
// Write in Combobox's dropdown list the distinct values from column Vocabulary.Name
TntComboBox1.Items.Clear;
with data.Query1 do
begin
Close;
sqltext := SQL.Text;
SQL.Text :='SELECT DISTINCT Name FROM marcdisplay';
Open;
First;
while Not Eof do
begin
TntComboBox1.Items.Add(FieldByName('Name').AsString);
Next;
end;
Close;
SQL.Text := sqltext;
Open;
end;
end;
procedure TNewMarcForm.BitBtn1Click(Sender: TObject);
var sqltext :string;
begin
with Data.Query1 do
begin
Close;
sqltext := SQL.Text;
SQL.Clear;
SQL.Add('SELECT * FROM marcdisplay');
SQL.Add('Where marcdisplay.Name = '+QuotedStr(TntComboBox1.Text));
Open;
First;
while Not Eof do
begin
data.marcdisplay.Append;
data.marcdisplay.FieldByName('Name').AsString := NewGroupForm.TntEdit1.Text;
data.marcdisplay.FieldByName('Lang').AsString := NewGroupForm.TntComboBox1.Text;
data.marcdisplay.FieldByName('Tag').AsString := FieldByName('Tag').AsString;
data.marcdisplay.FieldByName('Label').AsString := FieldByName('Label').AsString;
data.marcdisplay.FieldByName('print').AsBoolean := true;
data.marcdisplay.Post;
Next;
end;
Close;
SQL.Text := sqltext;
Open;
end;
NewGroupForm.ModalResult := mrOk;
close;
end;
end.