am_ajlb_xzs.pas
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit am_ajlb_xzs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, DB, DBClient, Buttons, Grids, DBGridEh, ExtCtrls;
  6. type
  7.   TAm_Ajlb_xz = class(TForm)
  8.     Panel1: TPanel;
  9.     DBGridEh2: TDBGridEh;
  10.     Panel2: TPanel;
  11.     SpeedButton1: TSpeedButton;
  12.     SpeedButton2: TSpeedButton;
  13.     SpeedButton3: TSpeedButton;
  14.     DataSource2: TDataSource;
  15.     ClientDataSet1: TClientDataSet;
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure DBGridEh2DblClick(Sender: TObject);
  18.     procedure SpeedButton2Click(Sender: TObject);
  19.     procedure SpeedButton3Click(Sender: TObject);
  20.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  21.     procedure SpeedButton1Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27. var
  28.   Am_Ajlb_xz: TAm_Ajlb_xz;
  29. implementation
  30. uses Am_Ajtzs, AM_ajlb_cxs;
  31. {$R *.dfm}
  32. procedure TAm_Ajlb_xz.FormCreate(Sender: TObject);
  33. begin
  34.   Clientdataset1.Close;
  35.   Clientdataset1.CommandText:='select * from sz_ajlb';
  36.   Clientdataset1.Open;
  37. end;
  38. procedure TAm_Ajlb_xz.DBGridEh2DblClick(Sender: TObject);
  39. begin
  40.  if Clientdataset1.recordcount<>0 then
  41.  begin
  42.     am_ajtz.DBEditeh2.Text:=Clientdataset1.fieldbyname('ajlb_dm').AsString;
  43.     close;
  44.  end;
  45. end;
  46. procedure TAm_Ajlb_xz.SpeedButton2Click(Sender: TObject);
  47. begin
  48.  if Clientdataset1.recordcount<>0 then
  49.  begin
  50.     Am_Ajtz.DBEditeh2.Text:=Clientdataset1.fieldbyname('ajlb_dm').AsString;
  51.     close;
  52.  end;
  53. end;
  54. procedure TAm_Ajlb_xz.SpeedButton3Click(Sender: TObject);
  55. begin
  56.  Close;
  57. end;
  58. procedure TAm_Ajlb_xz.FormClose(Sender: TObject; var Action: TCloseAction);
  59. begin
  60.  Clientdataset1.active:=false;
  61.  action:=cafree;
  62.  am_ajlb_xz:=nil;
  63. end;
  64. procedure TAm_Ajlb_xz.SpeedButton1Click(Sender: TObject);
  65. begin
  66.  if am_ajlb_cx=Nil then
  67.    begin
  68.     am_ajlb_cx:=Tam_ajlb_cx.create(application);
  69.     am_ajlb_cx.showmodal;
  70.    end;
  71. end;
  72. end.