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

Delphi控件源码

开发平台:

Delphi

  1. unit am_yhz_xzs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, DB, Buttons, Grids, DBGridEh, ExtCtrls;
  6. type
  7.   Tam_yhz_xz = class(TForm)
  8.     Panel1: TPanel;
  9.     DBGridEh1: TDBGridEh;
  10.     Panel2: TPanel;
  11.     SpeedButton1: TSpeedButton;
  12.     SpeedButton2: TSpeedButton;
  13.     SpeedButton3: TSpeedButton;
  14.     DataSource1: TDataSource;
  15.     procedure FormCreate(Sender: TObject);
  16.     procedure SpeedButton2Click(Sender: TObject);
  17.     procedure SpeedButton3Click(Sender: TObject);
  18.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  19.     procedure DBGridEh1DblClick(Sender: TObject);
  20.   private
  21.     { Private declarations }
  22.   public
  23.     { Public declarations }
  24.   end;
  25. var
  26.   am_yhz_xz: Tam_yhz_xz;
  27. implementation
  28. uses dms,u_public, Xt_Qxszs;
  29. {$R *.dfm}
  30. procedure Tam_yhz_xz.FormCreate(Sender: TObject);
  31. begin
  32.  dm.V_UandG.Close;
  33.  dm.v_uandg.CommandText:='P_yhz_xz';
  34.  dm.V_UandG.Open;
  35. end;
  36. procedure Tam_yhz_xz.SpeedButton2Click(Sender: TObject);
  37. begin
  38.  if dm.V_UandG.RecordCount<>0 then
  39.   begin
  40.     Xt_Cdqx.FlatEdit1.text:=dm.v_uandG.fieldbyname('yhz_mc').AsString;
  41.     Xt_Cdqx.FlatEdit2.text:=dm.v_uandG.fieldbyname('yhz_dm').AsString;
  42.     xt_cdqx.AllSelect.Enabled:=true;
  43.     xt_cdqx.AllClear.Enabled:=true;
  44.     xt_cdqx.Quit.Enabled:=true;
  45.     xt_cdqx.Save.Enabled:=true;
  46.     close;
  47.   end;
  48. end;
  49. procedure Tam_yhz_xz.SpeedButton3Click(Sender: TObject);
  50. begin
  51.  close;
  52. end;
  53. procedure Tam_yhz_xz.FormClose(Sender: TObject; var Action: TCloseAction);
  54. begin
  55.  dm.V_UandG.Active:=false;
  56.  action:=cafree;
  57.  am_yhz_xz:=nil;
  58. end;
  59. procedure Tam_yhz_xz.DBGridEh1DblClick(Sender: TObject);
  60. begin
  61.  if dm.V_UandG.RecordCount<>0 then
  62.   begin
  63.     Xt_Cdqx.FlatEdit1.text:=dm.v_uandG.fieldbyname('yhz_mc').AsString;
  64.     Xt_Cdqx.FlatEdit2.text:=dm.v_uandG.fieldbyname('yhz_dm').AsString;
  65.     xt_cdqx.AllSelect.Enabled:=true;
  66.     xt_cdqx.AllClear.Enabled:=true;
  67.     xt_cdqx.Quit.Enabled:=true;
  68.     xt_cdqx.Save.Enabled:=true;
  69.     close;
  70.   end;
  71. end;
  72. end.