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

📄 ywwizard.pas

📁 企业端数据申报系统:单位管理模块 单位查询. 业务申报模块 在线数据下载 在线数据上传 在线业务申核 申报业务查询 磁盘数据导出 磁盘数据导入 在线业务模块 在线业务
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  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 round((strtodatetime(ls_wkdate)-strtodatetime(ls_bdate))/365)<16 then
  begin
    application.MessageBox('参加工作时间必须晚于出生日期16年!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if strtodatetime(ls_joindate)<strtodatetime(ls_wkdate) then
  begin
    application.MessageBox('首次参保时间应晚于参加工作时间!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  if strtodatetime(ls_cgdate)<strtodatetime(ls_joindate) 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.LoctranCheck():boolean;
var
  li_organid,li_cpseno,li_oriorganid,li_oricpseno:integer;
  ls_cgdate,ls_cgdate2:string;
  lr_rewage:real;
begin
  if fcTC_loctran_neworgan.Text='' then
  begin
    application.MessageBox('请选择调动的目标单位或部门!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
    result:=false;
    exit;
  end;
  li_oriorganid:=strtoint(fcTC_loctran_oriorgan.SelectedNode.StringData);
  li_oricpseno:=GetOrganCpseno(query1,li_oriorganid);
  li_organid:=strtoint(fcTC_loctran_neworgan.SelectedNode.StringData);
  li_cpseno:=GetOrganCpseno(query1,li_organid);
  if li_oricpseno<>li_cpseno then
  begin
    if fcTC_loctran_upreason.Text='' then
    begin
      application.MessageBox('请选择调动原因!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      result:=false;
      exit;
    end;
    if fcTC_loctran_itcode.Text='' then
    begin
      application.MessageBox('请选择补缴档次!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      result:=false;
      exit;
    end;
    if trim(E_loctran_rewage.Text)='' then
    begin
      application.MessageBox('请输入缴费基数!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      result:=false;
      exit;
    end;
    try
      strtofloat(E_loctran_rewage.Text);
    except
      application.MessageBox('缴费基数不合法!','恩普软件',MB_OK+MB_IconInformation+MB_SystemModal);
      result:=false;
      exit;
    end;

    ls_cgdate:=trim(DE_loctran_cgdate.Text);
    lr_rewage:=strtofloat(E_loctran_rewage.Text);
    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;
    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;
  end;

  result:=true;
end;

function Tywwizard_form.DateCheck(Sour:string):boolean;
var
  date_check:Tdatetime;
begin
  try
    date_check:=strtodate(sour);
  except
    result:=false;
    exit;
  end;
  result:=true;
end;
{function Tywwizard_form.UptypeCanDo(status:string;uptype:string):boolean;
begin
  if (status='0') and ((uptype='01') or (uptype='03')) then
    result:=true
  else if (status='1') and ((uptype='04') or (uptype='05') or (uptype='06') or (uptype='07')) then
    result:=true
  else if (status='2') and ((uptype='02') or (uptype='06') or (uptype='07')) then
    result:=true
  else
    result:=false;

  exit;
end;}

function Tywwizard_form.QueryCodeName(code:String;codetype:string):string;
begin
  with query1 do
  begin
    close;
    sql.Clear;
    sql.Add('select name from sbcode where code='+#39+code+#39+' and type='+#39+codetype+#39);
    prepare;
    open;
    result:=fieldbyname('name').AsString;
    close;
    exit;
  end;
end;

function Tywwizard_form.QueryName(queryname:string;table:string;where:string):string;
var
  ls_sql:string;
begin
  with query1 do
  begin
    ls_sql:='select '+queryname+' name from '+table+' where '+where;
    close;
    sql.Clear;
    sql.Add(ls_sql);
    prepare;
    open;
    result:=fieldbyname('name').AsString;
    close;
    exit;
  end;
end;

function Tywwizard_form.AccessRight(iscode:string):boolean;
var
  ls_sql:string;
  li_organid:integer;
begin
  ls_sql:='select organid from psarch where trim(iscode)='+#39+iscode+#39;
  with datashare_form.Query1 do
  begin
    close;
    sql.Clear;
    sql.Add(ls_sql);
    prepare;
    open;
    if RecordCount=0 then
    begin
      close;
      result:=true;
      exit;
    end;
    li_organid:=fieldbyname('organid').AsInteger;

    ls_sql:='select count(*) reccount from unitright where operid='+inttostr(main_form.user.operid)+' and organid='+inttostr(li_organid);
    close;
    sql.Clear;
    sql.Add(ls_sql);
    prepare;
    open;
    if fieldbyname('reccount').AsInteger=0 then
    begin
      close;
      result:=false;
      exit;
    end else
    begin
      close;
      result:=true;
      exit;
    end;
  end;
end;

function Tywwizard_form.UptypeSelcected():string;
begin
  if RB_newinsure.Checked then
    result:='01'
  else if RB_reinsure.Checked then
    result:='02'
  else if RB_in.Checked then
    result:='03'
  else if RB_loctran.Checked then
    result:='04'
  else if RB_pause.Checked then
    result:='05'
  else if RB_out.Checked then
    result:='06'
  else if RB_stop.Checked then
    result:='07'
  else
    result:='';

  exit;
end;

procedure Tywwizard_form.FormCreate(Sender: TObject);
var
  ls_sql:string;
  i:integer;
  shape:TShape;
  color:TColor;
begin
  inherited;
  color:=$008396A0;
  for i:=0 to componentcount-1 do
  begin
    if components[i] is TfcTreeCombo then
    begin
      shape:=TShape.Create(self);
      shape.Parent:=(components[i] as TfcTreeCombo).Parent;
      shape.Shape:=stRectangle;
      shape.Pen.Color:=color;
      shape.Width:=(components[i] as TfcTreeCombo).Width+2;
      shape.Height:=(components[i] as TfcTreeCombo).Height+2;
      shape.Left:=(components[i] as TfcTreeCombo).Left-1;
      shape.Top:=(components[i] as TfcTreeCombo).Top-1;
      shape.Show;
      shape.SendToBack;
      {((components[i] as TfcTreeCombo).Parent as TTabControl).Canvas.Pen.Style:=psSolid;
      ((components[i] as TfcTreeCombo).Parent as TTabControl).Canvas.Pen.Color:=clred;//$008396A0;
      ((components[i] as TfcTreeCombo).Parent as TTabControl).Canvas.Pen.Width:=10;
      ((components[i] as TfcTreeCombo).Parent as TTabControl).Canvas.Rectangle((components[i] as TfcTreeCombo).Left-1,(components[i] as TfcTreeCombo).Top-1,(components[i] as TfcTreeCombo).Left+(components[i] as TfcTreeCombo).Width+1,(components[i] as TfcTreeCombo).Top+(components[i] as TfcTreeCombo).Height+1);
      }
    end else
    if components[i] is TEdit then
    begin
      shape:=TShape.Create(self);
      shape.Parent:=(components[i] as TEdit).Parent;
      shape.Shape:=stRectangle;
      shape.Pen.Color:=color;
      shape.Width:=(components[i] as TEdit).Width+2;
      shape.Height:=(components[i] as TEdit).Height+2;
      shape.Left:=(components[i] as TEdit).Left-1;
      shape.Top:=(components[i] as TEdit).Top-1;
      shape.Show;
      shape.SendToBack;
    end else
    if components[i] is TDateEdit then
    begin
      shape:=TShape.Create(self);
      shape.Parent:=(components[i] as TDateEdit).Parent;
      shape.Shape:=stRectangle;
      shape.Pen.Color:=color;
      shape.Width:=(components[i] as TDateEdit).Width+2;
      shape.Height:=(components[i] as TDateEdit).Height+2;
      shape.Left:=(components[i] as TDateEdit).Left-1;
      shape.Top:=(components[i] as TDateEdit).Top-1;
      shape.Show;
      shape.SendToBack;
    end else
    if components[i] is TMemo then

⌨️ 快捷键说明

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