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.     procedure SpeedButton3Click(Sender: TObject);
  27.   private
  28.     { Private declarations }
  29.   public
  30.     { Public declarations }
  31.   end;
  32. var
  33.   am_yjdy: Tam_yjdy;
  34. implementation
  35. uses dms,u_public, Am_Yjcxs, am_yjqc_Ps;
  36. {$R *.dfm}
  37. procedure Tam_yjdy.FormClose(Sender: TObject; var Action: TCloseAction);
  38. begin
  39.   dm.V_yjDY.Active:=false;
  40.   action:=cafree;
  41.   am_yjdy:=nil;
  42. end;
  43. procedure Tam_yjdy.RadioButton2Click(Sender: TObject);
  44. begin
  45.   radiobutton1.Checked:=false;
  46.   datetimepicker1.Enabled:=false;
  47.   datetimepicker2.Enabled:=false;
  48. end;
  49. procedure Tam_yjdy.RadioButton1Click(Sender: TObject);
  50. begin
  51.   radiobutton2.Checked:=false;
  52.   datetimepicker1.Enabled:=true;
  53.   datetimepicker2.Enabled:=true;
  54. end;
  55. procedure Tam_yjdy.SpeedButton1Click(Sender: TObject);
  56. var date1,date2,Swhere:tdatetime;
  57. begin
  58.   if radiobutton1.Checked=true  then
  59.    begin
  60.      date1:=datetimepicker1.DateTime;
  61.      date2:=datetimepicker2.DateTime;
  62.      dm.v_yjdy.Close;
  63.      dm.V_YJDY.commandtext:='select * from v_yjdy  where ajyj_yjrq>='+''''+datetimetostr(date1)+''+''''+' and  '+' ajyj_yjrq<= '+''''+datetimetostr(date2)+''''+'';
  64.      dm.V_YJDY.Open;
  65.    end
  66.   else
  67.    if radiobutton2.checked=true then
  68.       begin
  69.         am_yjcx:=tam_yjcx.create(application);
  70.         am_yjcx.showmodal;
  71.       end;
  72. end;
  73. procedure Tam_yjdy.SpeedButton2Click(Sender: TObject);
  74. begin
  75.  am_yjqc_P:=Tam_yjqc_P.create(application);
  76.  am_yjqc_P.quickrep1.preview;
  77. end;
  78. procedure Tam_yjdy.SpeedButton3Click(Sender: TObject);
  79. begin
  80.  Close;
  81. end;
  82. end.