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

📄 breakadd.pas

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

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BASEWIN, XPMenu, Menus, ActnList, ImgList, TFlatButtonUnit,
  ExtCtrls, Grids, DBGrids, StdCtrls, Mask, ToolEdit, TFlatComboBoxUnit,
  TFlatEditUnit, TFlatGroupBoxUnit, DB, RxMemDS;

type
  TBreakAdd_frm = class(Tbasewin_frm)
    FlatGroupBox1: TFlatGroupBox;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label9: TLabel;
    Label13: TLabel;
    Label17: TLabel;
    Label19: TLabel;
    Label20: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label11: TLabel;
    Label5: TLabel;
    Label12: TLabel;
    Label14: TLabel;
    FlatEdit1: TFlatEdit;
    FlatEdit2: TFlatEdit;
    FlatEdit3: TFlatEdit;
    FlatEdit7: TFlatEdit;
    FlatComboBox1: TFlatComboBox;
    FlatComboBox5: TFlatComboBox;
    FlatEdit5: TFlatEdit;
    FlatEdit4: TFlatEdit;
    FlatEdit6: TFlatEdit;
    FlatComboBox2: TFlatComboBox;
    DateEdit2: TDateEdit;
    DateEdit3: TDateEdit;
    FlatComboBox3: TFlatComboBox;
    DateEdit1: TDateEdit;
    GroupBox2: TGroupBox;
    Panel2: TPanel;
    Panel3: TPanel;
    FlatButton1: TFlatButton;
    FlatButton7: TFlatButton;
    Label1: TLabel;
    FlatComboBox6: TFlatComboBox;
    FlatButton8: TFlatButton;
    RMD: TRxMemoryData;
    RMDiscode: TStringField;
    RMDpsname: TStringField;
    RMDpsseno: TIntegerField;
    RMDyearno: TIntegerField;
    RMDcpsum: TFloatField;
    RMDcymonths: TIntegerField;
    RMDcypj: TFloatField;
    FlatComboBox7: TFlatComboBox;
    FlatEdit8: TFlatEdit;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    RMD0: TRxMemoryData;
    StringField3: TStringField;
    StringField4: TStringField;
    IntegerField4: TIntegerField;
    IntegerField5: TIntegerField;
    FloatField3: TFloatField;
    IntegerField6: TIntegerField;
    FloatField4: TFloatField;
    RMDnextyearjs: TFloatField;
    RMDindustry: TIntegerField;
    FlatComboBox8: TFlatComboBox;
    RMD0nextyearjs: TFloatField;
    procedure FormCreate(Sender: TObject);
    procedure FlatButton1Click(Sender: TObject);
    procedure RMD0NewRecord(DataSet: TDataSet);
    procedure FlatButton8Click(Sender: TObject);
    procedure DBGrid1KeyPress(Sender: TObject; var Key: Char);
    procedure FlatComboBox6Change(Sender: TObject);
  private
    { Private declarations }
    procedure init;
    procedure SaveInfo;
    procedure Save_sbdu_pswgcase;
    function  Validate_Data:boolean;
  public
    { Public declarations }
  end;

var
  BreakAdd_frm: TBreakAdd_frm;

implementation

uses datashare, Main, sbp_psagacct_all, onlinelogin;

{$R *.dfm}
procedure TBreakAdd_frm.init ;
begin
  Flatedit1.Text :='';
  Flatedit2.Text :='';
  Flatedit3.Text :='';
  Flatedit4.Text :='';
  Flatedit5.Text :='';
  Flatedit6.Text :='';
  Flatedit7.Text :='';

  Flatcombobox1.ItemIndex :=-1;
  Flatcombobox2.ItemIndex :=-1;
  Flatcombobox3.ItemIndex :=-1;
  Flatcombobox5.ItemIndex :=-1;
  Flatcombobox6.ItemIndex :=-1;

  Flatcombobox1.Text :='';
  Flatcombobox2.Text :='';
  Flatcombobox3.Text :=''; 
  Flatcombobox5.Text :='';
  Flatcombobox6.Text :='';

  DateEdit1.Date :=0;
  DateEdit2.Date :=0;
  DateEdit3.Date :=0;

  RMD.Close ;
  RMD.Open ;
  RMD0.Close ;
  RMD0.Open ;
end;

function  TBreakAdd_frm.Validate_Data :boolean;
var

  j:integer;
  list:TStrings;
begin
  result:=true;
  (*if trim(flatedit1.Text)='' then
    begin
      application.MessageBox('人员内码不能为空,请生成人员内码!','恩普软件',mb_iconerror+mb_ok);
      FlatButton5.SetFocus ;
      Result:=false;
      exit;
    end; *)
  if trim(flatedit2.Text)='' then
    begin
      application.MessageBox('人员姓名不能为空!','恩普软件',mb_iconerror+mb_ok);
      flatedit2.SetFocus  ;
      Result:=false;
      exit;
    end;
  if trim(flatedit3.Text)='' then
    begin
      application.MessageBox('人员身份证号码不能为空!','恩普软件',mb_iconerror+mb_ok);
      flatedit3.SetFocus;
      Result:=false;
      exit;
    end;
  if trim(flatedit4.Text)='' then
    begin
      application.MessageBox('人员联系电话不能为空!','恩普软件',mb_iconerror+mb_ok);
      flatedit4.SetFocus;
      Result:=false;
      exit;
    end;
  if trim(flatedit5.Text)='' then
    begin
      application.MessageBox('人员联系地址不能为空!','恩普软件',mb_iconerror+mb_ok);
      flatedit5.SetFocus;
      Result:=false;
      exit;
    end;
  if trim(flatedit6.Text)='' then
    begin
      application.MessageBox('人员邮编不能为空!','恩普软件',mb_iconerror+mb_ok);
      flatedit6.SetFocus;
      Result:=false;
      exit;
    end;
  if (dateedit1.Date=0) then
    begin
      application.MessageBox('输入的出生日期非法!','恩普软件',mb_iconerror+mb_ok);
      dateedit1.SetFocus ;
      result:=false;
      exit;
    end;
  if (dateedit2.Date=0) then
    begin
      application.MessageBox('输入的参加工作时间非法!','恩普软件',mb_iconerror+mb_ok);
      dateedit2.SetFocus ;
      result:=false;
      exit;
    end;
  if (dateedit3.Date=0) then
    begin
      application.MessageBox('输入的首次参保时间非法!','恩普软件',mb_iconerror+mb_ok);
      dateedit3.SetFocus ;
      result:=false;
      exit;
    end;
  if flatcombobox1.ItemIndex<0 then
    begin
      application.MessageBox('输入的性别非法!','恩普软件',mb_iconerror+mb_ok);
      flatcombobox1.SetFocus ;
      result:=false;
      exit;
    end;
  if flatcombobox2.ItemIndex<0 then
    begin
      application.MessageBox('输入的个人身份非法!','恩普软件',mb_iconerror+mb_ok);
      flatcombobox2.SetFocus ;
      result:=false;
      exit;
    end;
  if flatcombobox3.ItemIndex<0 then
    begin
      application.MessageBox('输入的用工形式非法!','恩普软件',mb_iconerror+mb_ok);
      flatcombobox3.SetFocus ;
      result:=false;
      exit;
    end; 
  if flatcombobox5.ItemIndex<0 then
    begin
      application.MessageBox('输入的户籍关系非法!','恩普软件',mb_iconerror+mb_ok);
      flatcombobox5.SetFocus ;
      result:=false;
      exit;
    end;
  if flatcombobox6.ItemIndex<0 then
    begin
      application.MessageBox('请选择所在单位!','恩普软件',mb_iconerror+mb_ok);
      flatcombobox6.SetFocus ;
      result:=false;
      exit;
    end;

  if RMD0.RecordCount<1 then
    if    application.MessageBox('是否允许该人员没有缴费记录?','恩普软件',mb_iconinformation+mb_okcancel)=idok then
    Result:=true
    else
    begin
      Result:=false;
      exit;
    end;
  RMD0.First ;
  list:=Tstringlist.Create;
  while not RMD0.Eof do
    begin
      if list.IndexOf(trim(RMD0.FieldByName('yearno').AsString))>=0 then
        begin
          application.MessageBox('输入了重复的年份!','恩普软件',mb_iconerror+mb_ok);
          list.Free ;
          Result:=false;
          exit;
        end;
      list.Add(trim(RMD0.FieldByName('yearno').AsString));
      if (trim(RMD0.FieldByName('yearno').AsString)='') then
        begin
          application.MessageBox('输入的年份非法!','恩普软件',mb_iconerror+mb_ok);
          Result:=false;  list.Free ;
          exit;
        end;
      if (trim(RMD0.fieldbyname('cpsum').AsString)='') then
        begin
          application.MessageBox('缴费总额不能为空!','恩普软件',mb_iconerror+mb_ok);
          Result:=false;  list.Free ;
          exit;
        end;
      if (trim(RMD0.fieldbyname('cymonths').AsString)='') then
        begin
          application.MessageBox('缴费总月数不能为空!','恩普软件',mb_iconerror+mb_ok);
          Result:=false;  list.Free ;
          exit;
        end;
      if (RMD0.FieldByName('cymonths').AsInteger>12) or (RMD0.FieldByName('cymonths').AsInteger<0 ) then
        begin
          application.MessageBox('输入的缴费总月数非法!','恩普软件',mb_iconerror+mb_ok);
          Result:=false;  list.Free ;
          exit;
        end;

      if (RMD0.FieldByName('yearno').AsInteger=1994) and (RMD0.FieldByName('nextyearjs').AsFloat>983) then
          begin
           application.MessageBox('1994年的月缴费基数不能超过983元!','恩普软件',mb_iconerror+mb_ok);
           exit;
         end;
       if (RMD0.FieldByName('yearno').AsInteger=1995) and (RMD0.FieldByName('nextyearjs').AsFloat>1400) then
          begin
           application.MessageBox('1995年的月缴费基数不能超过1440元!','恩普软件',mb_iconerror+mb_ok);
           exit;
         end;
       if (RMD0.FieldByName('yearno').AsInteger=1996) and (RMD0.FieldByName('nextyearjs').AsFloat>1655) then
          begin
           application.MessageBox('1996年的月缴费基数不能超过1655元!','恩普软件',mb_iconerror+mb_ok);
           exit;
         end;
       if (RMD0.FieldByName('yearno').AsInteger=1997) and (RMD0.FieldByName('nextyearjs').AsFloat>1854) then
          begin
           application.MessageBox('1997年的月缴费基数不能超过1854元!','恩普软件',mb_iconerror+mb_ok);
           exit;
         end;
       if (RMD0.FieldByName('yearno').AsInteger=1998) and (RMD0.FieldByName('nextyearjs').AsFloat>2097) then
          begin
           application.MessageBox('1998年的月缴费基数不能超过2097元!','恩普软件',mb_iconerror+mb_ok);
           exit;
         end;
      RMD0.next;
    end;
   list.Free ; 
end;

procedure TBreakAdd_frm.SaveInfo ;
begin
  with DataShare_frm.Query3 do
     begin
       close;
       sql.Clear ;
       sql.Add('insert into sbdb_psarch(psseno,psname,sex,bdate,iscode,identity,tel,');
       sql.Add('address,zip,wkdate,wkattr,status,joindate,household,notes,cpseno) values(');
       sql.Add(':p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:p10,:p11,:p12,:p13,:p14,:p15,:p16)');

       parambyname('p1').AsString :=flatedit1.Text ;
       parambyname('p2').AsString :=flatedit2.Text ;
       parambyname('p3').AsInteger :=Flatcombobox1.ItemIndex ;
       parambyname('p4').AsDateTime :=dateedit1.Date ;
       parambyname('p5').AsString :=flatedit3.Text ;
       parambyname('p6').AsInteger :=FlatCombobox2.ItemIndex+1;
       parambyname('p7').AsString :=flatedit4.Text ;
       parambyname('p8').AsString :=flatedit5.Text ;
       parambyname('p9').AsString :=flatedit6.Text ;
       parambyname('p10').AsDateTime :=dateedit2.Date ;
       parambyname('p11').AsInteger :=Flatcombobox3.ItemIndex ;
       parambyname('p12').AsInteger :=2;//Flatcombobox4.ItemIndex+1;
       parambyname('p13').AsDateTime :=dateedit3.Date ;
       parambyname('p14').AsInteger :=Flatcombobox5.ItemIndex ;
       parambyname('p15').AsString :=flatedit7.Text ;
       parambyname('p16').AsString :=flatcombobox7.Items[flatcombobox6.itemindex]; 
       prepare;
       execsql;
     end;
  with DataShare_frm.Query4 do
    begin
      close;
       sql.Clear ;                                                     //identity,
       sql.Add('insert into sbdz_pspause(psseno,psname,sex,bdate,iscode,tel,');
                                          //status,
       sql.Add('address,zip,wkdate,wkattr,joindate,household,notes,cpseno,opcode,opdate,procflg) values(');
       sql.Add(':p1,:p2,:p3,:p4,:p5,:p7,:p8,:p9,:p10,:p11,:p13,:p14,:p15,:p16,:p17,:P18,:p19)');
                                    //:p6,  :p12,
       parambyname('p1').AsString :=flatedit1.Text ;
       parambyname('p2').AsString :=flatedit2.Text ;
       parambyname('p3').AsInteger :=Flatcombobox1.ItemIndex ;
       parambyname('p4').AsDateTime :=dateedit1.Date ;
       parambyname('p5').AsString :=flatedit3.Text ;
       //parambyname('p6').AsInteger :=FlatCombobox2.ItemIndex+1;
       parambyname('p7').AsString :=flatedit4.Text ;
       parambyname('p8').AsString :=flatedit5.Text ;
       parambyname('p9').AsString :=flatedit6.Text ;
       parambyname('p10').AsDateTime :=dateedit2.Date ;
       parambyname('p11').AsInteger :=Flatcombobox3.ItemIndex ;
       //parambyname('p12').AsInteger :=2;//Flatcombobox4.ItemIndex+1;
       parambyname('p13').AsDateTime :=dateedit3.Date ;
       parambyname('p14').AsInteger :=Flatcombobox5.ItemIndex ;
       parambyname('p15').AsString :=flatedit7.Text ;
       parambyname('p16').AsString :=flatcombobox7.Items[flatcombobox6.itemindex];
       parambyname('p17').AsString :=main_frm.user.OPNAME;
       parambyname('p18').AsDateTime :=now;
       parambyname('p19').AsString :='1';

       prepare;
       execsql;
    end;

end;

procedure TBreakAdd_frm.Save_sbdu_pswgcase ;

⌨️ 快捷键说明

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