dutyeditfrm.pas
来自「考勤管理是企业内部管理的重要环节和基础」· PAS 代码 · 共 85 行
PAS
85 行
unit DutyEditFrm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DepartmentEditFrm, StdCtrls, Mask, DBCtrls, Buttons;
type
TDutyEditForm = class(TDepartmentEditForm)
procedure bbtnConfirmClick(Sender: TObject);
procedure bbtnAddClick(Sender: TObject);
procedure bbtnCancelClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ShowModalPopup(popup: integer);
end;
var
DutyEditForm: TDutyEditForm;
implementation
uses unDM2;
{$R *.DFM}
procedure TDutyEditForm.ShowModalPopup(popup : integer);
begin
case popup of
0: begin
bbtnAdd.Visible:=true;
DM2.tblDuty.append;
ShowModal;
end;
1: begin
bbtnAdd.Visible:=false;
DM2.tblDuty.edit;
ShowModal;
end;
end;
end;
procedure TDutyEditForm.bbtnConfirmClick(Sender: TObject);
begin
DM2.tblDuty.Post;
DutyEditForm.close;
end;
procedure TDutyEditForm.bbtnAddClick(Sender: TObject);
begin
DM2.tblDuty.append;
Dbedit1.SetFocus;
end;
procedure TDutyEditForm.bbtnCancelClick(Sender: TObject);
begin
DM2.tblDuty.Cancel;
DutyEditForm.close;
end;
procedure TDutyEditForm.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose := DM2.DataSetApplyUpdates(DM2.tblDuty, ModalResult = mrOK);
end;
procedure TDutyEditForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TDutyEditForm.FormDestroy(Sender: TObject);
begin
DutyEditForm:=Nil;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?