1 |
unit Unit3; |
2 |
|
3 |
{$mode objfpc}{$H+} |
4 |
|
5 |
interface |
6 |
|
7 |
uses |
8 |
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, |
9 |
DbCtrls, EditBtn, Unit2, IBCustomDataSet, IBQuery, db; |
10 |
|
11 |
type |
12 |
|
13 |
{ TAddEmployeeDlg } |
14 |
|
15 |
TAddEmployeeDlg = class(TEditEmployeeDlg) |
16 |
procedure FormShow(Sender: TObject); |
17 |
procedure IBDataSet1AfterInsert(DataSet: TDataSet); |
18 |
private |
19 |
{ private declarations } |
20 |
FNewEmpNo: integer; |
21 |
public |
22 |
{ public declarations } |
23 |
function ShowModal(var Emp_no: integer): TModalResult; |
24 |
end; |
25 |
|
26 |
var |
27 |
AddEmployeeDlg: TAddEmployeeDlg; |
28 |
|
29 |
implementation |
30 |
|
31 |
{$R *.lfm} |
32 |
|
33 |
uses Unit1; |
34 |
|
35 |
{ TAddEmployeeDlg } |
36 |
|
37 |
procedure TAddEmployeeDlg.FormShow(Sender: TObject); |
38 |
begin |
39 |
inherited; |
40 |
IBDataSet1.Append |
41 |
end; |
42 |
|
43 |
procedure TAddEmployeeDlg.IBDataSet1AfterInsert(DataSet: TDataSet); |
44 |
begin |
45 |
inherited; |
46 |
FNewEmpNo := DataSet.FieldByName('EMP_NO').AsInteger |
47 |
end; |
48 |
|
49 |
function TAddEmployeeDlg.ShowModal(var Emp_no: integer): TModalResult; |
50 |
begin |
51 |
Result := inherited ShowModal(-1); |
52 |
if Result = mrOK then |
53 |
Emp_no := FNewEmpNo; |
54 |
end; |
55 |
|
56 |
end. |
57 |
|