uqtfy_z.pas

来自「很好的汽车管理系统 很实用的 谢谢合作」· PAS 代码 · 共 92 行

PAS
92
字号

unit UQTFY_Z;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, ToolWin, ComCtrls, ExtCtrls, DBCtrls, Grids, DBGrids;

type
  TQTFY_Z = class(TForm)
    ToolBar1: TToolBar;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton4Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure DBGrid1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  QTFY_Z: TQTFY_Z;
  ActionCD:string;
implementation

uses UQTFY, UDM;

{$R *.dfm}

procedure TQTFY_Z.SpeedButton2Click(Sender: TObject);
begin
if dm.ADODSQTFY.RecordCount=0 then
    begin
      Application.MessageBox('已无记录可删除!','提示',0+MB_ICONINFORMATION);
      exit;
    end;
    if dm.ADODSQTFY.IsEmpty then
      exit;
    if ID_YES=application.MessageBox('确实要删除这条记录吗?','提示',MB_YESNO) then
    begin
      dm.ADODSQTFY.Delete;
    end;
end;

procedure TQTFY_Z.SpeedButton1Click(Sender: TObject);
begin
  Application.CreateForm(TQTFY,QTFY);
  ActionCD:='M';
  QTFY.GetAll;
  QTFY.ShowModal;
  QTFY.Free;
end;

procedure TQTFY_Z.SpeedButton4Click(Sender: TObject);
begin
  Close;
end;

procedure TQTFY_Z.FormCreate(Sender: TObject);
begin
  with dm.QQTFY do
  begin
    close;
    sql.Clear;
    sql.Add('select * from qtfy');
    open;
  end;
  dm.ADODSQTFY.Open;
end;

procedure TQTFY_Z.DBGrid1DblClick(Sender: TObject);
begin
  Application.CreateForm(TQTFY,QTFY);
  QTFY.GetAll;
  ActionCD:='M';
  QTFY.ShowModal;
  QTFY.Free;
end;

end.


⌨️ 快捷键说明

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