1 |
+ |
(* |
2 |
+ |
* IBX For Lazarus (Firebird Express) |
3 |
+ |
* |
4 |
+ |
* The contents of this file are subject to the Initial Developer's |
5 |
+ |
* Public License Version 1.0 (the "License"); you may not use this |
6 |
+ |
* file except in compliance with the License. You may obtain a copy |
7 |
+ |
* of the License here: |
8 |
+ |
* |
9 |
+ |
* http://www.firebirdsql.org/index.php?op=doc&id=idpl |
10 |
+ |
* |
11 |
+ |
* Software distributed under the License is distributed on an "AS |
12 |
+ |
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
13 |
+ |
* implied. See the License for the specific language governing rights |
14 |
+ |
* and limitations under the License. |
15 |
+ |
* |
16 |
+ |
* The Initial Developer of the Original Code is Tony Whyman. |
17 |
+ |
* |
18 |
+ |
* The Original Code is (C) 2015 Tony Whyman, MWA Software |
19 |
+ |
* (http://www.mwasoftware.co.uk). |
20 |
+ |
* |
21 |
+ |
* All Rights Reserved. |
22 |
+ |
* |
23 |
+ |
* Contributor(s): ______________________________________. |
24 |
+ |
* |
25 |
+ |
*) |
26 |
+ |
|
27 |
|
unit Unit1; |
28 |
|
|
29 |
|
{$mode objfpc}{$H+} |
154 |
|
|
155 |
|
uses IB, Unit2, Unit4, Unit5; |
156 |
|
|
157 |
+ |
const sNoName = '<no name>'; |
158 |
+ |
|
159 |
|
function ExtractDBException(msg: string): string; |
160 |
|
var Lines: TStringList; |
161 |
|
begin |
322 |
|
EmployeesJOB_CODE.AsString := 'SRep'; |
323 |
|
EmployeesJOB_GRADE.AsInteger := 4; |
324 |
|
EmployeesSALARY.AsCurrency := 20000; |
325 |
< |
EmployeesFIRST_NAME.AsString := '<no name>'; |
326 |
< |
EmployeesLAST_NAME.AsString := '<no name>'; |
325 |
> |
EmployeesFIRST_NAME.AsString := sNoName; |
326 |
> |
EmployeesLAST_NAME.AsString := sNoName; |
327 |
|
EmployeesHIRE_DATE.AsDateTime := now; |
328 |
|
EmployeesDEPT_NO.AsString := '000'; |
329 |
|
FDirty := true; |
337 |
|
|
338 |
|
procedure TForm1.EmployeesBeforeClose(DataSet: TDataSet); |
339 |
|
begin |
312 |
– |
with DataSet do |
313 |
– |
if State in [dsInsert,dsEdit] then |
314 |
– |
try |
315 |
– |
Post; |
316 |
– |
except |
317 |
– |
Cancel; |
318 |
– |
raise; |
319 |
– |
end; |
340 |
|
TotalsQuery.Active := false |
341 |
|
end; |
342 |
|
|
388 |
|
MessageDlg(E.Message,mtError,[mbOK],0); |
389 |
|
end; |
390 |
|
until IBDatabase1.Connected; |
391 |
< |
Reopen(0); |
391 |
> |
Application.QueueAsyncCall(@Reopen,0); |
392 |
|
end; |
393 |
|
|
394 |
|
procedure TForm1.EmployeesAfterDelete(DataSet: TDataSet); |