f_xscx.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:2k
- unit f_xscx;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, DB, ADODB, Grids, DBGrids, FR_DSet, FR_DBSet,
- FR_Class;
- type
- Tform2 = class(TForm)
- GroupBox1: TGroupBox;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- GroupBox2: TGroupBox;
- b_xs: TBitBtn;
- b_cx: TBitBtn;
- b_gb: TBitBtn;
- DBGrid1: TDBGrid;
- DataSource1: TDataSource;
- ado_xshou: TADOQuery;
- ado_xshous_bh: TStringField;
- ado_xshous_dw: TStringField;
- ado_xshous_dz: TStringField;
- ado_xshous_sq: TStringField;
- ado_xshous_stime: TDateTimeField;
- ado_xshous_xtime: TDateTimeField;
- b_dy: TBitBtn;
- frReport1: TfrReport;
- frDBDataSet1: TfrDBDataSet;
- procedure b_cxClick(Sender: TObject);
- procedure b_xsClick(Sender: TObject);
- procedure b_gbClick(Sender: TObject);
- procedure b_dyClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- form2: Tform2;
- implementation
- uses f_main;
- {$R *.dfm}
- procedure Tform2.b_cxClick(Sender: TObject);
- var
- ss:string;
- begin
- ss:='';
- if edit1.Text+edit2.Text+edit3.Text='' then
- begin
- application.MessageBox('您没有输入查询条件!请重新输入!','提示',mb_ok+mb_iconinformation);
- end
- else
- begin
- if edit1.Text<>'' then
- ss:=ss+'and s_bh='+''''+edit1.Text+'''';
- if edit2.Text<>'' then
- ss:=ss+'and g_dw='+''''+edit2.Text+'''';
- if edit3.Text<>'' then
- ss:=ss+'and g_sq='+''''+edit3.Text+'''';
- ss:='select * from xshuo where 1=1'+ss;
- ado_xshou.Close;
- ado_xshou.SQL.Clear;
- ado_xshou.SQL.Add(ss);
- ado_xshou.Open;
- if ado_xshou.RecordCount=0 then
- begin
- application.MessageBox('没有符合要求的记录,请和管理员联系,请重新输入!','提示',mb_ok+mb_iconinformation);
- end;
- end;
- end;
- procedure Tform2.b_xsClick(Sender: TObject);
- begin
- ado_xshou.Close;
- ado_xshou.SQL.Clear;
- ado_xshou.SQL.Add('select * from xshuo');
- ado_xshou.Open;
- end;
- procedure Tform2.b_gbClick(Sender: TObject);
- begin
- close;
- end;
- procedure Tform2.b_dyClick(Sender: TObject);
- begin
- frReport1.ShowReport;
- end;
- end.