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

Delphi控件源码

开发平台:

Delphi

  1. unit am_dz_ajxzs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ExtCtrls, DB, Grids, DBGridEh, Buttons, DBClient;
  6. type
  7.   Tam_dz_ajxz = class(TForm)
  8.     Panel1: TPanel;
  9.     Panel2: TPanel;
  10.     DBGridEh2: TDBGridEh;
  11.     DataSource2: TDataSource;
  12.     SpeedButton1: TSpeedButton;
  13.     SpeedButton2: TSpeedButton;
  14.     SpeedButton3: TSpeedButton;
  15.     ClientDataSet1: TClientDataSet;
  16.     procedure SpeedButton3Click(Sender: TObject);
  17.     procedure FormCreate(Sender: TObject);
  18.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  19.     procedure DBGridEh2DblClick(Sender: TObject);
  20.     procedure SpeedButton2Click(Sender: TObject);
  21.     procedure SpeedButton1Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27. var
  28.   am_dz_ajxz: Tam_dz_ajxz;
  29. implementation
  30. uses dms, am_jygl_bjs,Am_Yhgl_Zcs, am_ajjs_cxs, am_ajjss;
  31. {$R *.dfm}
  32. procedure Tam_dz_ajxz.SpeedButton3Click(Sender: TObject);
  33. begin
  34.  close;
  35. end;
  36. procedure Tam_dz_ajxz.FormCreate(Sender: TObject);
  37. begin
  38.   Clientdataset1.Close;
  39.   Clientdataset1.CommandText:='select * from V_Ajxz';
  40.   Clientdataset1.Open;
  41. end;
  42. procedure Tam_dz_ajxz.FormClose(Sender: TObject; var Action: TCloseAction);
  43. begin
  44.   dm.V_ajgl_yxh.Active:=false;
  45.   action:=cafree;
  46.   am_dz_ajxz:=nil;
  47. end;
  48. procedure Tam_dz_ajxz.DBGridEh2DblClick(Sender: TObject);
  49. begin
  50.  am_jygl_bj.DBEdit2.Text:=Clientdataset1.fieldbyname('aj_xh').AsString;
  51.  close;
  52. end;
  53. procedure Tam_dz_ajxz.SpeedButton2Click(Sender: TObject);
  54. begin
  55.  am_jygl_bj.DBEdit2.Text:=Clientdataset1.fieldbyname('aj_xh').AsString;
  56.  close;
  57. end;
  58. procedure Tam_dz_ajxz.SpeedButton1Click(Sender: TObject);
  59. begin
  60.  if am_ajjs_cx=Nil then
  61.   begin
  62.     am_ajjs_cx:=Tam_ajjs_cx.create(self);
  63.     am_ajjs_cx.ShowModal;
  64.   end;
  65. end;
  66. end.