gzchange.pas

来自「《Delphi 7数据库应用技术与实例》源代码__工资管理系统.rar《Delp」· PAS 代码 · 共 77 行

PAS
77
字号
unit gzchange;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables;

type
  TInitiateForm = class(TForm)
    Label1: TLabel;
    Table1: TTable;
    procedure FormActivate(Sender: TObject);
    procedure FormClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  InitiateForm: TInitiateForm;

implementation
  uses main;
{$R *.dfm}

procedure TInitiateForm.FormActivate(Sender: TObject);
begin
     Table1.DatabaseName:='gzgl';
     //操作员数据表
     Table1.TableName:='operator';
     if Table1.Exists then
     begin
          Table1.EmptyTable;
     end;
     Table1.active:=true;
     Table1.append;
     Table1.Edit;
     Table1.FieldByname('name').AsString:='admin';
     Table1.FieldByname('password').AsString:='12345678';
     Table1.FieldByname('department').AsString:='财务处';
     Table1.FieldByname('time').AsDateTime:=Date();
     Table1.FieldByname('right_1').AsBoolean:=true;
     Table1.FieldByname('right_2').AsBoolean:=true;
     Table1.FieldByname('right_3').AsBoolean:=true;
     Table1.Post;
     Table1.Active:=false;
     //职工资料与工资数据表
     Table1.TableName:='salary';
     if Table1.Exists then
     begin
          Table1.EmptyTable;
     end;
           //当月实发工资表
          Table1.TableName:='month_salary';
          if Table1.Exists then
          begin
                Table1.EmptyTable;
          end;
       //当年的操作历史表;
          Table1.TableName:=str;
          if Table1.Exists then
          begin
                Table1.EmptyTable;
          end;
     label1.Caption:='初始化结束!点击任意键退出!';
     close;
end;

procedure TInitiateForm.FormClick(Sender: TObject);
begin
    close;
end;

end.

⌨️ 快捷键说明

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