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

📄 historyfind.~pas

📁 这是一个小型的工资管理系统
💻 ~PAS
字号:
unit historyfind;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, SUIButton, DB, Grids, DBGrids, DBTables, StdCtrls, ExtCtrls,
  SUIForm;

type
  Thistory = class(TForm)
    history: TsuiForm;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    Label3: TLabel;
    Edit3: TEdit;
    Table1: TTable;
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    suiButton1: TsuiButton;
    procedure FormActivate(Sender: TObject);
    procedure suiButton1Click(Sender: TObject);
    procedure Edit3Exit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  history: Thistory;

implementation

{$R *.dfm}

procedure Thistory.FormActivate(Sender: TObject);
begin
table1.DatabaseName:='DBMS';
edit1.Text:=' ';
edit2.Text:=' ';
edit3.Text:=' ';
edit1.SetFocus;
end;

procedure Thistory.suiButton1Click(Sender: TObject);
begin
table1.Active:=false;
close;
end;

procedure Thistory.Edit3Exit(Sender: TObject);
var str:string;
begin
   str:='is'+edit3.Text;
   table1.TableName:=str;
    
   if table1.Exists then
   begin  if edit1.Text<>' ' then
           begin
           showmessage('asd');
           table1.AddIndex('','number',[ixprimary]);
           table1.IndexFieldNames:='number';
           table1.Active:=true;
           table1.EditRangeStart;
           table1.FieldByName('number').AsString:=edit1.Text;
           table1.EditRangeEnd;
           table1.FieldByName('number').AsString:=edit1.Text;
           table1.ApplyRange;
           end
           else if edit2.Text<>'' then
           begin
           table1.AddIndex('','number',[ixprimary]);
           table1.AddIndex('','name',[]);
           table1.IndexFieldNames:='name';
           table1.Active:=true;
           table1.EditRangeStart;
           table1.FieldByName('name').AsString:=edit1.Text;
           table1.EditRangeEnd;
           table1.FieldByName('name').AsString:=edit1.Text;
           table1.ApplyRange;
           end
           else
           begin table1.Active:=true;
                 suibutton1.SetFocus;
           end;
   end
   else
   begin
   application.MessageBox('系统中没有你所要的年份资料,请检查!','提示信息',mb_ok);
   suibutton1.SetFocus;
   end;


end;

end.

⌨️ 快捷键说明

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