f_kqcx.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:2k
- unit f_kqcx;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGrids, ExtCtrls, StdCtrls, DB, ADODB, Buttons;
- type
- Tw_kqcx = class(TForm)
- Label1: TLabel;
- GroupBox1: TGroupBox;
- GroupBox2: TGroupBox;
- b_xs: TBitBtn;
- b_cx: TBitBtn;
- b_gb: TBitBtn;
- data_kaoqin: TDataSource;
- ado_kaoqin: TADOQuery;
- Label2: TLabel;
- Label3: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Label4: TLabel;
- ComboBox1: TComboBox;
- Panel1: TPanel;
- DBGrid1: TDBGrid;
- ado_kaoqinrs_id: TStringField;
- ado_kaoqinrs_name: TStringField;
- ado_kaoqins_time: TDateTimeField;
- ado_kaoqinx_time: TDateTimeField;
- ado_kaoqinc_sh: TStringField;
- procedure b_cxClick(Sender: TObject);
- procedure b_xsClick(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_kqcx: Tw_kqcx;
- implementation
- uses f_main;
- {$R *.dfm}
- procedure Tw_kqcx.b_cxClick(Sender: TObject);
- var
- ss:string;
- begin
- ss:='';
- if edit1.Text+combobox1.Text+edit2.Text='' then
- begin
- application.MessageBox('您没有输入查询条件!请重新输入!','提示',mb_ok+mb_iconinformation);
- end
- else
- begin
- if edit1.Text<>'' then
- ss:=ss+'and rs_id='+''''+edit1.Text+'''';
- if edit2.Text<>'' then
- ss:=ss+'and rs_name='+''''+edit2.Text+'''';
- if combobox1.Text<>'' then
- ss:=ss+'and c_sh='+''''+combobox1.Text+'''';
- ss:='select * from kaoqin where 1=1'+ss;
- ado_kaoqin.Close;
- ado_kaoqin.SQL.Clear;
- ado_kaoqin.SQL.Add(ss);
- ado_kaoqin.Open;
- if ado_kaoqin.RecordCount=0 then
- begin
- application.MessageBox('没有符合要求的记录,请和管理员联系,请重新输入!','提示',mb_ok+mb_iconinformation);
- end;
- end;
- end;
- procedure Tw_kqcx.b_xsClick(Sender: TObject);
- begin
- ado_kaoqin.Close;
- ado_kaoqin.SQL.Clear;
- ado_kaoqin.SQL.Add('select * from kaoqin') ;
- ado_kaoqin.Open;
- end;
- procedure Tw_kqcx.b_gbClick(Sender: TObject);
- begin
- close;
- end;
- procedure Tw_kqcx.FormCreate(Sender: TObject);
- begin
- w_main.Enabled:=false;
- end;
- procedure Tw_kqcx.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- w_main.Enabled:=true;
- end;
- end.