?? frmdatastatistic.pas
字號:
unit frmDataStatistic;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, DBCtrls, Mask,DB, Grids,
DBGrids, StrUtils;
type
TCheckWorkTimeForm = class(TForm)
cmdClose: TButton;
grbPersonInfo: TGroupBox;
panWelcome: TPanel;
cmdOK: TButton;
Label1: TLabel;
txtPassword: TEdit;
Label2: TLabel;
cboRecordType: TComboBox;
txtPersonID: TEdit;
Label3: TLabel;
procedure txtPersonIDKeyPress(Sender: TObject; var Key: Char);
procedure cmdOKClick(Sender: TObject);
procedure cmdCloseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CheckWorkTimeForm: TCheckWorkTimeForm;
implementation
uses mdDataBases, Common;
{$R *.dfm}
procedure TCheckWorkTimeForm.txtPersonIDKeyPress(Sender: TObject;
var Key: Char);
begin
if Key=chr(13) then
begin
with dmDataSource.tblPerson do
begin
DisableControls;
Locate('ID',txtPersonID.Text,[loCaseInsensitive]);
EnableControls;
end;
txtPassword.SetFocus;
end;
end;
procedure TCheckWorkTimeForm.cmdOKClick(Sender: TObject);
var
strPassword:string;
begin
strPassword:=Base64Decode(dmDataSource.tblPerson['PERSON_PASSWORD']);
if UpperCase(Trim(txtPassword.Text))=UpperCase(strPassword) then
begin
if RightStr(cboRecordType.Text,2)='上班' then
begin
dmDataSource.qrySQLCommand.Active:=False;
with dmDataSource.qrySQLCommand.SQL do
begin
Clear;
Add('SELECT PERSON_ID ');
Add('FROM HOLIDAY_TABLE Holiday_table ');
Add('WHERE (ENDTIME >= :dtmStartTime ');
Add('AND PERSON_ID = :strID)');
end;
dmDataSource.qrySQLCommand.ParamByName('dtmStartTime').Value:=Now;
dmDataSource.qrySQLCommand.ParamByName('strID').Value:='0001';
dmDataSource.qrySQLCommand.Active:=True;
if dmDataSource.qrySQLCommand.RecordCount>0 then Exit;
end;
if RightStr(cboRecordType.Text,2)='下班' then
begin
dmDataSource.qrySQLCommand.Active:=False;
with dmDataSource.qrySQLCommand.SQL do
begin
Clear;
Add('SELECT PERSON_ID ');
Add('FROM HOLIDAY_TABLE Holiday_table ');
Add('WHERE (STARTTIME <= :dtmStartTime ');
Add('AND PERSON_ID = :strID)');
end;
dmDataSource.qrySQLCommand.ParamByName('dtmStartTime').Value:=Now;
dmDataSource.qrySQLCommand.ParamByName('strID').Value:='0001';
dmDataSource.qrySQLCommand.Active:=True;
if dmDataSource.qrySQLCommand.RecordCount>0 then Exit;
end;
dmDataSource.RecordWorkTime(cboRecordType.Text);
end
else
Messagebox(Application.Handle,'您輸入的密碼不對,請重新輸入','密碼錯誤',16);
end;
procedure TCheckWorkTimeForm.cmdCloseClick(Sender: TObject);
begin
CheckWorkTimeForm.Close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -