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

Delphi控件源码

开发平台:

Delphi

  1. unit am_yjdys;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, ExtCtrls, ComCtrls, Buttons, Grids, DBGridEh, DB,
  6.   DBClient;
  7. type
  8.   Tam_yjdy = class(TForm)
  9.     Panel1: TPanel;
  10.     DateTimePicker1: TDateTimePicker;
  11.     DateTimePicker2: TDateTimePicker;
  12.     Label1: TLabel;
  13.     RadioButton1: TRadioButton;
  14.     RadioButton2: TRadioButton;
  15.     SpeedButton1: TSpeedButton;
  16.     Panel2: TPanel;
  17.     DBGridEh1: TDBGridEh;
  18.     V_AJDY: TDataSource;
  19.     SpeedButton2: TSpeedButton;
  20.     SpeedButton3: TSpeedButton;
  21.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  22.     procedure RadioButton2Click(Sender: TObject);
  23.     procedure RadioButton1Click(Sender: TObject);
  24.     procedure SpeedButton1Click(Sender: TObject);
  25.     procedure SpeedButton2Click(Sender: TObject);
  26.   private
  27.     { Private declarations }
  28.   public
  29.     { Public declarations }
  30.   end;
  31. var
  32.   am_yjdy: Tam_yjdy;
  33. implementation
  34. uses dms,u_public, Am_Yjcxs, am_yjqc_Ps;
  35. {$R *.dfm}
  36. procedure Tam_yjdy.FormClose(Sender: TObject; var Action: TCloseAction);
  37. begin
  38.   dm.V_yjDY.Active:=false;
  39.   action:=cafree;
  40.   am_yjdy:=nil;
  41. end;
  42. procedure Tam_yjdy.RadioButton2Click(Sender: TObject);
  43. begin
  44.   radiobutton1.Checked:=false;
  45.   datetimepicker1.Enabled:=false;
  46.   datetimepicker2.Enabled:=false;
  47. end;
  48. procedure Tam_yjdy.RadioButton1Click(Sender: TObject);
  49. begin
  50.   radiobutton2.Checked:=false;
  51.   datetimepicker1.Enabled:=true;
  52.   datetimepicker2.Enabled:=true;
  53. end;
  54. procedure Tam_yjdy.SpeedButton1Click(Sender: TObject);
  55. var date1,date2,Swhere:tdatetime;
  56. begin
  57.   if radiobutton1.Checked=true  then
  58.    begin
  59.      date1:=datetimepicker1.DateTime;
  60.      date2:=datetimepicker2.DateTime;
  61.      dm.v_yjdy.Close;
  62.      dm.V_YJDY.commandtext:='select * from v_yjdy  where ajyj_yjrq>='+''''+datetimetostr(date1)+''+''''+' and  '+' ajyj_yjrq<= '+''''+datetimetostr(date2)+''''+'';
  63.      dm.V_YJDY.Open;
  64.    end
  65.   else
  66.    if radiobutton2.checked=true then
  67.       begin
  68.         am_yjcx:=tam_yjcx.create(application);
  69.         am_yjcx.showmodal;
  70.       end;
  71. end;
  72. procedure Tam_yjdy.SpeedButton2Click(Sender: TObject);
  73. begin
  74.  am_yjqc_P:=Tam_yjqc_P.create(application);
  75.  am_yjqc_P.quickrep1.preview;
  76. end;
  77. end.