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

📄 ywwizard.~pas

📁 企业端数据申报系统:单位管理模块 单位查询. 业务申报模块 在线数据下载 在线数据上传 在线业务申核 申报业务查询 磁盘数据导出 磁盘数据导入 在线业务模块 在线业务
💻 ~PAS
📖 第 1 页 / 共 5 页
字号:
unit ywwizard;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, basepop, StdCtrls, TFlatButtonUnit, TFlatEditUnit,
  TFlatComboBoxUnit, ComCtrls, jpeg, ExtCtrls, Mask, TFlatMaskEditUnit, DB,
  DBTables, fcTreeView, fcCombo, fctreecombo,DateUtils, XPMenu,
  TFlatMemoUnit, ToolEdit, DBCtrls;

type
  Tywwizard_form = class(Tbasepop_form)
    Panel1: TPanel;
    Image1: TImage;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    GroupBox3: TGroupBox;
    FB_previous: TFlatButton;
    FB_next: TFlatButton;
    FB_cancel: TFlatButton;
    FB_help: TFlatButton;
    FCB_iscode: TFlatComboBox;
    Label1: TLabel;
    Label2: TLabel;
    RB_newinsure: TRadioButton;
    RB_reinsure: TRadioButton;
    RB_in: TRadioButton;
    RB_pause: TRadioButton;
    RB_stop: TRadioButton;
    RB_out: TRadioButton;
    RB_loctran: TRadioButton;
    TabSheet2: TTabSheet;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    L_chgtime: TLabel;
    L_chgreason: TLabel;
    Query1: TQuery;
    fcTreeView1: TfcTreeView;
    fcTC_othchg_upreason: TfcTreeCombo;
    TC_othchg: TTabControl;
    TC_new: TTabControl;
    Label3: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    E_othchg_iscode: TEdit;
    E_othchg_agcardno: TEdit;
    E_othchg_psname: TEdit;
    E_othchg_sex: TEdit;
    M_othchg_notes: TMemo;
    fcTC_new_organ: TfcTreeCombo;
    E_new_psname: TEdit;
    E_new_iscode: TEdit;
    fcTC_new_sex: TfcTreeCombo;
    fcTC_new_identity: TfcTreeCombo;
    fcTC_new_household: TfcTreeCombo;
    fcTC_new_wkattr: TfcTreeCombo;
    E_new_rewage: TEdit;
    fcTC_new_upreason: TfcTreeCombo;
    fcTC_new_itcode: TfcTreeCombo;
    E_new_bfidyears: TEdit;
    M_new_notes: TMemo;
    DE_othchg_cgdate: TDateEdit;
    DE_new_bdate: TDateEdit;
    DE_new_wkdate: TDateEdit;
    DE_new_joindate: TDateEdit;
    DE_new_cgdate: TDateEdit;
    TC_loctran: TTabControl;
    Label24: TLabel;
    Label25: TLabel;
    fcTC_loctran_neworgan: TfcTreeCombo;
    fcTC_loctran_oriorgan: TfcTreeCombo;
    fcTC_loctran_upreason: TfcTreeCombo;
    DE_loctran_cgdate: TDateEdit;
    Label26: TLabel;
    Label27: TLabel;
    Label28: TLabel;
    Label29: TLabel;
    E_loctran_rewage: TEdit;
    fcTC_loctran_itcode: TfcTreeCombo;
    Label30: TLabel;
    E_loctran_iscode: TEdit;
    Label31: TLabel;
    E_loctran_agcardno: TEdit;
    Label32: TLabel;
    E_loctran_psname: TEdit;
    Label33: TLabel;
    E_loctran_sex: TEdit;
    M_loctran_notes: TMemo;
    Label34: TLabel;
    TabSheet3: TTabSheet;
    Label35: TLabel;
    M_info: TFlatMemo;
    procedure FormCreate(Sender: TObject);
    procedure FB_nextClick(Sender: TObject);
    procedure FB_cancelClick(Sender: TObject);
    procedure FB_helpClick(Sender: TObject);
    procedure FB_previousClick(Sender: TObject);
    procedure fcTC_loctran_neworganChange(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
    uptype,iscode:string;
    minrewage,maxrewage:real;
    function DateCheck(Sour:string):boolean;
    function UptypeSelcected():string;
    function AccessRight(iscode:string):boolean;
    function QueryCodeName(code:String;codetype:string):string;
    function QueryName(queryname:string;table:string;where:string):string;
    function OthchgCheck():boolean;
    function NewCheck():boolean;
    function LoctranCheck():boolean;
    //function UptypeCanDo(status:string;uptype:string):boolean;
  public
    { Public declarations }
  end;

var
  ywwizard_form: Tywwizard_form;

implementation
uses datashare,JoinSoci, main,hh,commlist;

{$R *.dfm}

function Tywwizard_form.OthchgCheck():boolean;
var
  ls_cgdate,ls_cgdate2:string;
begin
  if fcTC_othchg_upreason.Text='' then
  begin
    application.MessageBox('请选择变动原因!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  ls_cgdate:=trim(DE_othchg_cgdate.Text);
  if ls_cgdate='-  -' then
  begin
    application.MessageBox('请输入变动日期!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if not DateCheck(ls_cgdate) then
  begin
    application.MessageBox('变动日期不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if strtodatetime(ls_cgdate)>today then
  begin
    application.MessageBox('变动日期不能晚于当前日期!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;

  with datashare_form.Query1 do
  begin
    close;
    sql.Clear;
    sql.Add('select max(a.cgdate) cgdate from psupcase a,psarch b where a.manid=b.manid and a.procflg='+#39+'4'+#39+' and trim(b.iscode)='+#39+iscode+#39);
    prepare;
    open;
    ls_cgdate2:=fieldbyname('cgdate').AsString;
    if ls_cgdate2<>'' then
    begin
      if strtodatetime(ls_cgdate)<strtodatetime(ls_cgdate2) then
      begin
        application.MessageBox('变动日期不能早于上次变动日期!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
        result:=false;
        exit;
      end;
    end;
    close;
  end;

  result:=true;
end;

function Tywwizard_form.NewCheck():boolean;
var
  ls_psname,ls_bdate,ls_wkdate,ls_joindate,ls_cgdate,ls_cgdate2:string;
  ls_rewage,ls_bfidyears:string;
  lr_rewage,lr_bfidyears:real;
begin
  ls_psname:=trim(E_new_psname.Text);
  ls_bdate:=trim(DE_new_bdate.Text);
  ls_wkdate:=trim(DE_new_wkdate.Text);
  ls_joindate:=trim(DE_new_joindate.Text);
  ls_cgdate:=trim(DE_new_cgdate.Text);
  ls_rewage:=trim(E_new_rewage.Text);
  ls_bfidyears:=trim(E_new_bfidyears.Text);
  if ls_bfidyears='' then
    ls_bfidyears:='0.00';

  if fcTC_new_organ.Text='' then
  begin
    application.MessageBox('请选择单位或部门!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ls_psname='' then
  begin
    application.MessageBox('请输入姓名!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  //showmessage(ls_bdate);
  if ls_bdate='-  -' then
  begin
    application.MessageBox('请输入出生日期!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_sex.Text='' then
  begin
    application.MessageBox('请选择性别!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_identity.Text='' then
  begin
    application.MessageBox('请选择身份!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_household.Text='' then
  begin
    application.MessageBox('请选择户籍关系!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ls_wkdate='-  -' then
  begin
    application.MessageBox('请输入参加工作时间!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_wkattr.Text='' then
  begin
    application.MessageBox('请选择用工性质!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ls_joindate='-  -' then
  begin
    application.MessageBox('请输入首次参保时间!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ls_cgdate='-  -' then
  begin
    application.MessageBox('请输入本次应保时间!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ls_rewage='' then
  begin
    application.MessageBox('请输入缴费基数!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_upreason.Text='' then
  begin
    application.MessageBox('请选择参保原因!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if fcTC_new_itcode.Text='' then
  begin
    application.MessageBox('请选择补缴档次!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;

  try
    lr_rewage:=strtofloat(ls_rewage);
  except
    application.MessageBox('缴费基数不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if (lr_rewage<minrewage) or (lr_rewage>maxrewage) then
  begin
    application.MessageBox(pchar('缴费基数必须在'+FormatFloat('#0.00',minrewage)+'至'+FormatFloat('#0.00',maxrewage)+'之间'),'恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;

  try
    lr_bfidyears:=strtofloat(ls_bfidyears);
  except
    application.MessageBox('视同缴费年限不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if ((round(lr_bfidyears*100)) mod 100)>12 then
  begin
    application.MessageBox('视同缴费年限不合理!'+#10#13+'整数部分为年数,小数部门为月数,不足两位的前面补0,例如9年8个月应写为9.08。','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;

  if not DateCheck(ls_bdate) then
  begin
    application.MessageBox('出生日期不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if not DateCheck(ls_wkdate) then
  begin
    application.MessageBox('参加工作时间不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if not DateCheck(ls_joindate) then
  begin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -