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

Delphi控件源码

开发平台:

Delphi

  1. unit am_dz_xzs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ExtCtrls, Grids, DBGridEh, Buttons, DB, DBClient;
  6. type
  7.   Tam_dz_xz = class(TForm)
  8.     Panel1: TPanel;
  9.     Panel2: TPanel;
  10.     SpeedButton1: TSpeedButton;
  11.     SpeedButton2: TSpeedButton;
  12.     DBGridEh1: TDBGridEh;
  13.     DataSource1: TDataSource;
  14.     SpeedButton3: TSpeedButton;
  15.     procedure SpeedButton2Click(Sender: TObject);
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  18.     procedure DBGridEh1DblClick(Sender: TObject);
  19.     procedure SpeedButton3Click(Sender: TObject);
  20.     procedure SpeedButton1Click(Sender: TObject);
  21.     procedure FormShow(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27. var
  28.   am_dz_xz: Tam_dz_xz;
  29. implementation
  30. uses dms,u_public,am_jygl_bjs, am_dzbjs, ljszs;
  31. {$R *.dfm}
  32. procedure Tam_dz_xz.SpeedButton2Click(Sender: TObject);
  33. begin
  34.  if dm.V_DZ.RecordCount<>0 then
  35.   begin
  36.     am_jygl_bj.DBEditEh2.Text:=dbgrideh1.Columns[0].DisplayText;
  37.     close;
  38.   end;
  39. end;
  40. procedure Tam_dz_xz.FormCreate(Sender: TObject);
  41. begin
  42.   {Dm.am_dz.Active:=true;
  43.   dm.am_jygz.Active:=true;
  44.   DM.sz_zjlb.Active:=true;}
  45.   dm.V_DZ.Close;
  46.   dm.V_DZ.CommandText:='select * from v_dz';
  47.   dm.V_DZ.Open;
  48. end;
  49. procedure Tam_dz_xz.FormClose(Sender: TObject; var Action: TCloseAction);
  50. begin
  51.   Dm.am_dz.Active:=false;
  52.   dm.am_jygz.Active:=false;
  53.   DM.sz_zjlb.Active:=false;
  54.   dm.V_DZ.Active:=false;
  55.   action:=cafree;
  56.   am_dz_xz:=nil;
  57. end;
  58. procedure Tam_dz_xz.DBGridEh1DblClick(Sender: TObject);
  59. var
  60.   k:string;
  61. begin
  62.  if dm.V_DZ.RecordCount<>0 then
  63.   begin
  64.     k:=dbgrideh1.Columns[0].DisplayText;
  65.     am_jygl_bj.DBEditEh2.clear;
  66.     am_jygl_bj.DBEditEh2.text:=k;
  67.     close;
  68.   end;
  69. end;
  70. procedure Tam_dz_xz.SpeedButton3Click(Sender: TObject);
  71. begin
  72.  close;
  73. end;
  74. procedure Tam_dz_xz.SpeedButton1Click(Sender: TObject);
  75. begin
  76.   if am_dzbj=nil then
  77.   begin
  78.      am_dzbj:=Tam_dzbj.create(application);
  79.      dm.am_dz.Close;
  80.      dm.am_dz.CommandText:='select * from am_dz where dz_dm='+''''+''''+'';
  81.      dm.am_dz.Open;
  82.      am_dzbj.Label1.Caption:='增加读者';
  83.      am_dzbj.showmodal;
  84.   end;
  85. end;
  86. procedure Tam_dz_xz.FormShow(Sender: TObject);
  87. begin
  88. {  clientdataset1.Close;
  89.   clientdataset1.CommandText:='select * from v_dz';
  90.   clientdataset1.Open; }
  91. end;
  92. end.