📄 inputjoindate.~pas
字号:
unit inputjoindate;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, basepop, TFlatButtonUnit, Mask, TFlatMaskEditUnit, StdCtrls,
ToolEdit, XPMenu;
type
Tinputjoindate_form = class(Tbasepop_form)
FB_ok: TFlatButton;
FB_cancel: TFlatButton;
Label1: TLabel;
Label2: TLabel;
DE_joindate: TDateEdit;
procedure FormCreate(Sender: TObject);
procedure FB_okClick(Sender: TObject);
procedure FB_cancelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
inputjoindate_form: Tinputjoindate_form;
implementation
uses JoinSoci, datashare;
{$R *.dfm}
procedure Tinputjoindate_form.FormCreate(Sender: TObject);
begin
inherited;
joinsoci_form.Joindate:='';
//DE_joindate.Text:=datetostr(date);
end;
procedure Tinputjoindate_form.FB_okClick(Sender: TObject);
var
ls_joindate,ls_wkdate:string;
year,month,day:word;
li_manid:integer;
begin
inherited;
ls_joindate:=trim(DE_joindate.Text);
if ls_joindate='' then
begin
application.MessageBox('日期不能为空!','恩普软件',MB_OK+MB_IconStop+MB_SystemModal);
DE_joindate.SetFocus;
exit;
end;
try
DecodeDate(strtodateTime(ls_joindate),year,month,day);
except
on e:exception do
begin
application.MessageBox('非法日期!','恩普软件',MB_OK+MB_IconStop+MB_SystemModal);
DE_joindate.SetFocus;
exit;
end;
end;
li_manid:=joinsoci_form.Query1MANID.AsInteger;
with datashare_form.Query1 do
begin
close;
sql.Clear;
sql.Add('select wkdate from psarch where manid='+inttostr(li_manid));
prepare;
open;
ls_wkdate:=fieldbyname('wkdate').AsString;
close;
end;
if strtodatetime(ls_joindate)<strtodatetime(ls_wkdate) then
begin
application.MessageBox('首次参保时间不能早于参加工作时间','恩普软件',MB_OK+MB_IconStop+MB_SystemModal);
exit;
end;
if strtodatetime(ls_joindate)>now then
begin
application.MessageBox('首次参保时间不能晚于当前时间','恩普软件',MB_OK+MB_IconStop+MB_SystemModal);
exit;
end;
joinsoci_form.Joindate:=ls_joindate;
close;
end;
procedure Tinputjoindate_form.FB_cancelClick(Sender: TObject);
begin
inherited;
joinsoci_form.Joindate:='';
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -