⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmdatastatistic.~pas

📁 被系统名叫生产信息管理系统
💻 ~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 + -