f_gzcx.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:3k
- unit f_gzcx;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGrids, ExtCtrls, StdCtrls, Buttons, DB, ADODB;
- type
- Tw_gzcx = class(TForm)
- Panel1: TPanel;
- DBGrid1: TDBGrid;
- GroupBox1: TGroupBox;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- GroupBox2: TGroupBox;
- b_xs: TBitBtn;
- b_cx: TBitBtn;
- b_gb: TBitBtn;
- ado_gzxt: TADOQuery;
- Edit3: TEdit;
- Label1: TLabel;
- Edit4: TEdit;
- data_gzxt: TDataSource;
- ado_gzxtg_nf: TStringField;
- ado_gzxtg_yf: TStringField;
- ado_gzxtrs_id: TStringField;
- ado_gzxtrs_name: TStringField;
- ado_gzxtg_jbgz: TFloatField;
- ado_gzxtg_fdgz: TFloatField;
- ado_gzxtg_grss: TFloatField;
- ado_gzxtg_gwgz: TFloatField;
- ado_gzxtg_shbz: TFloatField;
- ado_gzxtg_bxkc: TFloatField;
- ado_gzxtg_zgz: TFloatField;
- ado_gzxtg_zkc: TFloatField;
- ado_gzxtg_sfgz: TFloatField;
- procedure b_xsClick(Sender: TObject);
- procedure b_cxClick(Sender: TObject);
- procedure b_gbClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- w_gzcx: Tw_gzcx;
- implementation
- uses f_main;
- {$R *.dfm}
- procedure Tw_gzcx.b_xsClick(Sender: TObject);
- begin
- ado_gzxt.Close;
- ado_gzxt.SQL.Clear;
- ado_gzxt.SQL.Add('select * from gzxt');
- ado_gzxt.Open;
- end;
- procedure Tw_gzcx.b_cxClick(Sender: TObject);
- var
- ss:string;
- begin
- ss:='';
- if edit1.Text+edit2.Text+edit3.Text+edit4.Text='' then
- begin
- application.MessageBox('您没有输入查询条件!请重新输入!','提示',mb_ok+mb_iconinformation);
- end
- else
- begin
- if edit1.Text<>'' then
- ss:=ss+'and g_nf='+''''+edit1.Text+'''';
- if edit2.Text<>'' then
- ss:=ss+'and g_yf='+''''+edit2.Text+'''';
- if edit3.Text<>'' then
- ss:=ss+'and rs_id='+''''+edit3.Text+'''';
- if edit4.Text<>'' then
- ss:=ss+'and rs_name='+''''+edit4.Text+'''';
- ss:='select * from gzxt where 1=1'+ss;
- ado_gzxt.Close;
- ado_gzxt.SQL.Clear;
- ado_gzxt.SQL.Add(ss);
- ado_gzxt.Open;
- if ado_gzxt.RecordCount=0 then
- begin
- application.MessageBox('没有符合要求的记录,请和管理员联系,请重新输入!','提示',mb_ok+mb_iconinformation);
- end;
- end;
- end;
- procedure Tw_gzcx.b_gbClick(Sender: TObject);
- begin
- close;
- end;
- procedure Tw_gzcx.FormCreate(Sender: TObject);
- begin
- w_main.Enabled:=false;
- end;
- procedure Tw_gzcx.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- w_main.Enabled:=true;
- end;
- end.