cframemenu.pas
来自「Delphi深度探索,Delphi深度探索(第二版)」· PAS 代码 · 共 75 行
PAS
75 行
unit CFrameMenu;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
IWControl, IWHTMLControls, IWCompButton, IWCompLabel, IWAppForm, IWContainer,
IWRegion, IWBaseControl, ServerController;
type
TFrameMenu = class(TFrame)
iwlCorp: TIWLink;
iwlHuman: TIWLink;
iwlQuery: TIWLink;
iwlVisit: TIWLink;
procedure iwlCorpClick(Sender: TObject);
procedure iwlHumanClick(Sender: TObject);
procedure iwlQueryClick(Sender: TObject);
procedure iwlVisitClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
// procedure Move(AFormClass: TIWAppFormClass);
procedure IncVisitTimes;
end;
implementation
uses IWInit, IWTypes, CFormCorpList, CFormHumanList, CFormQuery,
CFormVisit, CWebUtils, DatamoduleUnit;
{$R *.dfm}
procedure TFrameMenu.IncVisitTimes;
begin
//增加用户访问数
with dmHR do
begin
adocHr.BeginTrans;
try
adocEdit.commandText := format('Update tblOperator Set VisitTimes=VisitTimes+1 where OperId=%d', [UserSession.Id]);
adocEdit.Execute;
adocHr.CommitTrans;
except
adocHR.RollbackTrans;
end;
end;
end;
procedure TFrameMenu.iwlCorpClick(Sender: TObject);
begin
Move(TformCorpList);
IncVisitTimes;
end;
procedure TFrameMenu.iwlHumanClick(Sender: TObject);
begin
Move(TformHumanList);
IncVisitTimes;
end;
procedure TFrameMenu.iwlQueryClick(Sender: TObject);
begin
Move(TformQuery);
IncVisitTimes;
end;
procedure TFrameMenu.iwlVisitClick(Sender: TObject);
begin
Move(TformVisit);
IncVisitTimes;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?