-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNewBibliographicUnit.pas
executable file
·147 lines (124 loc) · 3.39 KB
/
NewBibliographicUnit.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
unit NewBibliographicUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DBCtrls, TntDBCtrls, TntStdCtrls, Mask, Buttons, DateUtils,
ExtCtrls, TntButtons, TntForms, DB;
type
TNewBibliographicForm = class(TTntForm)
Label1: TTntLabel;
Label2: TTntLabel;
Label3: TTntLabel;
Label4: TTntLabel;
Label5: TTntLabel;
Label6: TTntLabel;
Label7: TTntLabel;
Label9: TTntLabel;
Label10: TTntLabel;
Label11: TTntLabel;
Label12: TTntLabel;
Label19: TTntLabel;
DBEdit1: TTntEdit;
DBEdit3: TTntEdit;
DBEdit4: TTntEdit;
DBEdit5: TTntEdit;
Langcombobox: TTntComboBox;
materialComboBox: TTntComboBox;
DBEdit6: TTntEdit;
DBMemo1: TTntMemo;
DBCheckBox1: TTntCheckBox;
DBEdit7: TTntEdit;
DBEdit8: TTntEdit;
DBEdit12: TTntEdit;
DBMemo3: TTntMemo;
BitBtn1: TTntBitBtn;
BitBtn2: TTntBitBtn;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
NewBibliographicForm: TNewBibliographicForm;
implementation
uses zoomit, common, DataUnit, utility, MainUnit, ProgresBarUnit, GlobalProcedures;
{$R *.dfm}
procedure TNewBibliographicForm.FormShow(Sender: TObject);
begin
ActiveControl := LangComboBox;
LangComboBox.ItemIndex := 0;
MaterialComboBox.ItemIndex := 0;
DBEdit1.Text := '';
DBMemo3.Text := '';
DBEdit3.Text := '';
DBEdit4.Text := '';
DBEdit5.Text := '';
DBEdit6.Text := '';
DBEdit7.Text := '';
DBEdit8.Text := '';
DBEdit12.Text := '';
DBMemo1.Text := '';
end;
procedure TNewBibliographicForm.FormClose(Sender: TObject;
var Action: TCloseAction);
var
temp : UTF8String;
recno1 : integer;
begin
if ModalResult = mrOk Then
begin
data.MyConnection1.Connected := True;
recno1 := NewMARCRecord(FastRecordCreator.base_table);
with data.SecureBasket do
begin
EditTable(data.SecureBasket);
temp := makemrcfromnew;
if length(temp) >= 10 then temp[10] := 'a';
EnhanceMARC(recno1, temp);
GetBlob('text').IsUnicode := True;
GetBlob('text').AsWideString := StringToWideString(temp, Greek_codepage);
TBlobField(FieldByName('text')).Modified := True;
PostTable(data.secureBasket);
FastRecordCreator.markbook := recno1;
FastRecordCreator.gotorecno := recno1;
RecordUpdated(myzebrahost, 'insert', recno1, temp);
end;
savedmarc := true;
end;
end;
procedure TNewBibliographicForm.FormActivate(Sender: TObject);
var
hlp,s : WideString;
p : integer;
begin
Langcombobox.Clear;
materialComboBox.Clear;
s := FastRecordCreator.Languages+',';
while (s <> '') do
begin
p := pos(',',s);
if (p <> 0) then
begin
hlp := copy(s,1,p-1);
s:= copy(s,p+1,length(s));
langcombobox.Items.Add(hlp);
end
end;
s := fastrecordcreator.Materials+',';
while (s <> '') do
begin
p := pos(',',s);
if (p <> 0) then
begin
hlp := copy(s,1,p-1);
s:= copy(s,p+1,length(s));
materialcombobox.Items.Add(hlp);
end
end;
Langcombobox.ItemIndex := 0;
materialComboBox.ItemIndex := 0;
end;
end.