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

📄 retireaccount.~pas

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

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BASEWIN, TFlatSpeedButtonUnit, StdCtrls, TFlatEditUnit,
  ExtCtrls, Grids, DBGrids, ComCtrls, XPMenu, Menus, ActnList, ImgList,typinfo,
  TFlatButtonUnit, TFlatComboBoxUnit, DB, RxMemDS, TFlatGroupBoxUnit;
const screenwidth=1024;
const screenheight=768;
type
  TRetireAccount_frm = class(Tbasewin_frm)
    Panel3: TPanel;
    Panel2: TPanel;
    FlatButton1: TFlatButton;
    RMD: TRxMemoryData;
    DataSource1: TDataSource;
    GroupBox1: TGroupBox;
    Panel6: TPanel;
    DBGrid3: TDBGrid;
    FlatGroupBox1: TFlatGroupBox;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label9: TLabel;
    Label5: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label18: TLabel;
    Label20: TLabel;
    Label22: TLabel;
    Label29: TLabel;
    Label30: TLabel;
    Label23: TLabel;
    Label31: TLabel;
    Label32: TLabel;
    Label24: TLabel;
    Label33: TLabel;
    FlatEdit2: TFlatEdit;
    FlatEdit3: TFlatEdit;
    FlatEdit4: TFlatEdit;
    FlatEdit6: TFlatEdit;
    FlatEdit7: TFlatEdit;
    FlatEdit11: TFlatEdit;
    FlatEdit12: TFlatEdit;
    FlatEdit13: TFlatEdit;
    FlatEdit18: TFlatEdit;
    FlatEdit20: TFlatEdit;
    FlatEdit25: TFlatEdit;
    FlatEdit26: TFlatEdit;
    FlatEdit27: TFlatEdit;
    FlatEdit28: TFlatEdit;
    FlatEdit30: TFlatEdit;
    FlatEdit31: TFlatEdit;
    FlatEdit32: TFlatEdit;
    FlatEdit33: TFlatEdit;
    Panel4: TPanel;
    Label1: TLabel;
    FlatSpeedButton1: TFlatSpeedButton;
    Label34: TLabel;
    FlatEdit1: TFlatEdit;
    FlatComboBox1: TFlatComboBox;
    FlatComboBox2: TFlatComboBox;
    FlatComboBox4: TFlatComboBox;
    Label6: TLabel;
    FlatComboBox5: TFlatComboBox;
    FlatComboBox6: TFlatComboBox;
    RMDpsname: TStringField;
    RMDiscode: TStringField;
    RMDpsaccount: TFloatField;
    RMDaccount: TFloatField;
    RMDdrawout: TFloatField;
    RMDBasicAccount: TFloatField;
    RMDaccountfor2003: TFloatField;
    RMDratio: TStringField;
    GroupBox2: TGroupBox;
    Label7: TLabel;
    FlatEdit41: TFlatEdit;
    Label8: TLabel;
    FlatEdit42: TFlatEdit;
    Label10: TLabel;
    FlatEdit43: TFlatEdit;
    Label14: TLabel;
    FlatEdit44: TFlatEdit;
    Label15: TLabel;
    FlatEdit45: TFlatEdit;
    GroupBox3: TGroupBox;
    DBGrid1: TDBGrid;
    DataSource2: TDataSource;
    Label16: TLabel;
    FlatEdit46: TFlatEdit;
    FlatComboBox3: TFlatComboBox;
    FlatEdit51: TFlatEdit;
    Label17: TLabel;
    FlatEdit52: TFlatEdit;
    Label19: TLabel;
    FlatEdit53: TFlatEdit;
    Label21: TLabel;
    FlatEdit54: TFlatEdit;
    Label25: TLabel;
    FlatEdit55: TFlatEdit;
    Label26: TLabel;
    FlatEdit56: TFlatEdit;
    Label27: TLabel;
    FlatButton2: TFlatButton;
    Label28: TLabel;
    FlatEdit8: TFlatEdit;
    Label35: TLabel;
    FlatEdit47: TFlatEdit;
    Label36: TLabel;
    FlatEdit57: TFlatEdit;
    Label37: TLabel;
    FlatEdit48: TFlatEdit;
    Label38: TLabel;
    FlatEdit58: TFlatEdit;
    Label39: TLabel;
    Label40: TLabel;
    FlatEdit59: TFlatEdit;
    FlatEdit49: TFlatEdit;
    Label41: TLabel;
    FlatEdit40: TFlatEdit;
    Label42: TLabel;
    FlatEdit50: TFlatEdit;
    procedure FormCreate(Sender: TObject);
    procedure FlatComboBox1Change(Sender: TObject);
    procedure FlatSpeedButton1Click(Sender: TObject);
    procedure FlatComboBox6Change(Sender: TObject);
    procedure FlatEdit41Change(Sender: TObject);
    procedure FlatButton1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
    procedure FlatButton2Click(Sender: TObject);
    procedure FlatEdit1KeyPress(Sender: TObject; var Key: Char);
  private
    year,mon,day:Word;
    changed:boolean;
    index:integer;  //记录combobox1的前一个itemindex
    procedure init;
    procedure showdata;
    procedure SaveData;
    procedure  SetEditReadOnly(bl:boolean);
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RetireAccount_frm: TRetireAccount_frm;

implementation

uses datashare, sbp_rtacctints, Main;

{$R *.dfm}
procedure TRetireAccount_frm.init ;
begin
  //flatcombobox6.Text :='';
  //flatcombobox1.Text :='';
  //flatedit1.Text :='';
  flatedit2.Text :='';
  flatedit3.Text :='';
  flatedit4.Text :='';
  flatedit6.Text :='';
  flatedit7.Text :='';
  flatedit11.Text :='';
  flatedit12.Text :='';
  flatedit32.Text :='';
  flatedit18.Text :='';
  flatedit20.Text :='';
  flatedit25.Text :='';
  flatedit26.Text :='';
  flatedit27.Text :='';
  flatedit28.Text :='';
  flatedit30.Text :='';
  flatedit31.Text :='';
  flatedit33.Text :='';
  flatedit13.Text :='';
  flatedit8.Text :='';

  flatedit40.Text :='';
  flatedit41.Text :='';
  flatedit42.Text :='';
  flatedit43.Text :='';
  flatedit44.Text :='';
  flatedit45.Text :='';
  flatedit46.Text :='';
  flatedit47.Text :='';
  flatedit48.Text :='';
  Flatedit49.Text :='';

  flatedit50.Text :='';
  flatedit51.Text :='';
  flatedit52.Text :='';
  flatedit53.Text :='';
  flatedit54.Text :='';
  flatedit55.Text :='';
  flatedit56.Text :='';
  flatedit57.Text :='';
  flatedit58.Text :='';
  flatedit59.Text :='';
  
  RMD.Close ;
  DataSource2.DataSet :=nil;
  changed:=false;
  //if Datasource2.DataSet.Active  then DataSource2.DataSet.Close ;
end;
procedure TRetireAccount_frm.SetEditReadOnly(bl:boolean);
begin
{//----------------------------------20040907-------------------
   Flatedit41.Text :='';
   flatedit42.Text :='';
   flatedit43.Text :='';
   flatedit44.Text :='';
   flatedit45.Text :='';
   flatedit46.Text :='';

   Flatedit41.ReadOnly :=bl;
   Flatedit42.ReadOnly :=bl;
   Flatedit43.ReadOnly :=bl;
   Flatedit44.ReadOnly :=bl;
   Flatedit45.ReadOnly :=bl;
   flatedit46.ReadOnly :=bl; }
   flatedit40.ReadOnly :=true;
   Flatedit41.ReadOnly :=true;
   Flatedit42.ReadOnly :=true;
   Flatedit43.ReadOnly :=true;
   Flatedit44.ReadOnly :=true;
   Flatedit45.ReadOnly :=true;
   flatedit46.ReadOnly :=true;
   flatedit47.ReadOnly :=true;
   flatedit48.ReadOnly :=true;
   flatedit49.ReadOnly :=true;
end;

procedure TRetireAccount_frm.showdata ;
var
  ratio:double;
begin
  //inherited;
  if RMD.Active then  RMD.Close ;
  SeteditReadOnly(false);
  ratio:=0;
  
   
  with Datashare_frm.Query1 do
    begin
      close;
      sql.Clear ;
      sql.Add('select psseno,psname,sex,NATIONAL,BDATE ,ISCODE,LXDH,ADDRESS,IDENTITY,WKDATE ,WKATTR, ');
      sql.add('HOUSEHOLD,STATUS,PYYEARS,RTDATE,zip,AGCARDNO,ACCTNO,MADDR,RTWG ,PSACPY,ACCTSAVE,ACPSSAVE,Accountfor2003  from sbdb_rtarch  ') ;
      sql.add(' where psseno=:param');
      parambyname('param').AsString :=Flatcombobox2.Items[Flatcombobox1.itemindex];
      prepare;
      open;

      if recordcount>0 then
        begin
          //RMD.AppendRecord([Fieldbyname('rtwg').AsFloat,Fieldbyname('psacpy').AsFloat,Fieldbyname('acctsave').AsFloat,Fieldbyname('acpssave').AsFloat,nil]);


          Flatedit2.Text :=Fieldbyname('psseno').AsString ;
          Flatedit3.Text :=Fieldbyname('psname').AsString ;

          if Fieldbyname('sex').AsInteger=0 then Flatedit4.Text :='女'  else Flatedit4.Text :='男';

          Flatedit6.Text :=Fieldbyname('NATIONAL').AsString ;
          Flatedit7.Text :=Fieldbyname('BDATE').AsString ;
          Flatedit11.Text :=Fieldbyname('ISCODE').AsString ;
          Flatedit12.Text :=Fieldbyname('LXDH').AsString ;
          flatedit13.Text :=Fieldbyname('ADDRESS').AsString ;

          Flatedit18.Text :=Fieldbyname('WKDATE').AsString ;
          if trim(Fieldbyname('WKATTR').AsString)<>'' then
          if Fieldbyname('WKATTR').AsInteger=0 then FlatEdit20.text:='固定工'
             else if Fieldbyname('WKATTR').AsInteger=1 then Flatedit20.Text:='合同工'
             else if Fieldbyname('WKATTR').AsInteger=2  then Flatedit20.Text:='临时工'
             else if Fieldbyname('WKATTR').AsInteger=3  then Flatedit20.Text:='农民工'; {}

          Flatedit25.Text :=Fieldbyname('acctno').AsString ;
          Flatedit26.Text :=Fieldbyname('maddr').AsString ;
          if trim(Fieldbyname('HOUSEHOLD').AsString)<>'' then
          if Fieldbyname('HOUSEHOLD').AsInteger=0 then Flatedit27.Text :='城镇' else Flatedit27.Text :='农村';
          if trim(Fieldbyname('STATUS').AsString)<>'' then
          if Fieldbyname('STATUS').AsInteger=0  then Flatedit28.Text:='正常'
             else if Fieldbyname('STATUS').AsInteger=1 then Flatedit28.Text:='暂停'
             else Flatedit28.Text:='终止';

          Flatedit30.Text :=Fieldbyname('PYYEARS').AsString ;
          Flatedit31.Text :=Fieldbyname('RTDATE').AsString ;
          Flatedit32.Text :=Fieldbyname('zip').AsString ;
          Flatedit33.Text :=Fieldbyname('AGCARDNO').AsString ;

          //if trim(Fieldbyname('acctsave').AsString)='0' then ratio:=0 else ratio:=(Fieldbyname('acpssave').AsFloat/Fieldbyname('acctsave').AsFloat)*100 ;
          if trim(Fieldbyname('rtwg').AsString)='0' then ratio:=0 else ratio:=(Fieldbyname('psacpy').AsFloat/Fieldbyname('rtwg').AsFloat)*100 ;
          decodedate(Fieldbyname('rtdate').asdatetime,year,mon,day);
          //if  year<=1998 then seteditreadonly(false);
          
          if  year=1999  then   flatedit41.ReadOnly :=true;
          if  (year=2000) or (year=2001)  then   begin
                               flatedit41.ReadOnly :=true;
                               flatedit42.ReadOnly :=true;
                               end;
          if year=2002 then
                          begin
                           flatedit41.ReadOnly :=true;
                           flatedit42.ReadOnly :=true;
                           flatedit43.ReadOnly :=true;
                           end;
          if year>2002 then seteditreadonly(true);
          
          RMD.Open ;
          RMD.AppendRecord([Fieldbyname('psname').AsString,Fieldbyname('iscode').AsString,Fieldbyname('acpssave').AsFloat,
                           Fieldbyname('acctsave').AsFloat,Fieldbyname('psacpy').AsFloat,Fieldbyname('rtwg').AsFloat,formatfloat('0.00',ratio)+'%',Fieldbyname('Accountfor2003').AsFloat]);

        end;

⌨️ 快捷键说明

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