ujyzxx_z.pas

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

PAS
90
字号
unit UJYZXX_Z;

interface

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

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

var
  JYZXX_Z: TJYZXX_Z;
  ActionCD:String;
implementation

uses UDM, UJYZXX;

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

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

procedure TJYZXX_Z.SpeedButton1Click(Sender: TObject);
begin
  Application.CreateForm(TJYZXX,JYZXX);
  ActionCD:='M';
  JYZXX.GetAll;
  JYZXX.ShowModal;
  JYZXX.Free;
end;

procedure TJYZXX_Z.FormCreate(Sender: TObject);
begin
  with dm.QJYZXX do
  begin
    close;
    sql.Clear;
    sql.Add('select * from JYZXX');
    open;
  end;
  dm.ADODSJYZXX.Open;
end;

procedure TJYZXX_Z.DBGrid1DblClick(Sender: TObject);
begin
  Application.CreateForm(TJYZXX,JYZXX);
  JYZXX.GetAll;
  ActionCD:='M';
  JYZXX.ShowModal;
  JYZXX.Free;
end;

end.


⌨️ 快捷键说明

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