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

📄 inputjoindate.pas

📁 企业端数据申报系统:单位管理模块 单位查询. 业务申报模块 在线数据下载 在线数据上传 在线业务申核 申报业务查询 磁盘数据导出 磁盘数据导入 在线业务模块 在线业务
💻 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 + -