f_rscx.pas
上传用户:lcqxtx
上传日期:2013-02-15
资源大小:530k
文件大小:3k
- unit f_rscx;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Grids, DBGrids, StdCtrls, Buttons, DB, ADODB, FR_DSet, FR_DBSet,
- FR_Class;
- type
- Tw_rscx = class(TForm)
- GroupBox1: TGroupBox;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- gb_1: TGroupBox;
- Label1: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- ComboBox1: TComboBox;
- Edit1: TEdit;
- Edit3: TEdit;
- GroupBox2: TGroupBox;
- b_xs: TBitBtn;
- b_cx: TBitBtn;
- b_dy: TBitBtn;
- b_gb: TBitBtn;
- DBGrid1: TDBGrid;
- data_rsxt: TDataSource;
- ado_rsxt: TADOQuery;
- ado_rsxtrs_id: TStringField;
- ado_rsxtrs_name: TStringField;
- ado_rsxtrs_depart: TStringField;
- ado_rsxtrs_job: TStringField;
- ado_rsxtrs_xueli: TStringField;
- ado_rsxtrs_xb: TStringField;
- ado_rsxtrs_nl: TIntegerField;
- ado_rsxtrs_gl: TIntegerField;
- ado_rsxtrs_zzmm: TStringField;
- ado_rsxtrs_hf: TStringField;
- ComboBox2: TComboBox;
- frReport1: TfrReport;
- frDBDataSet1: TfrDBDataSet;
- procedure RadioButton1Click(Sender: TObject);
- procedure b_xsClick(Sender: TObject);
- procedure b_cxClick(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure b_gbClick(Sender: TObject);
- procedure b_dyClick(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- w_rscx: Tw_rscx;
- bsy:string;
- implementation
- uses f_main;
- {$R *.dfm}
- procedure Tw_rscx.RadioButton1Click(Sender: TObject);
- begin
- if RadioButton1.Checked then
- bsy:='rs_gl'
- else
- bsy:='rs_xueli';
- end;
- procedure Tw_rscx.b_xsClick(Sender: TObject);
- begin
- ado_rsxt.Close;
- ado_rsxt.SQL.Clear;
- ado_rsxt.SQL.Add('select * from rsxt order by '+bsy);
- ado_rsxt.Open;
- end;
- procedure Tw_rscx.b_cxClick(Sender: TObject);
- var
- ss:string;
- begin
- ss:='';
- if edit1.Text+combobox1.Text+combobox2.Text='' then
- begin
- application.MessageBox('您没有输入查询条件!请重新输入!','提示',mb_ok+mb_iconinformation);
- end
- else
- begin
- if combobox1.Text<>'' then
- ss:=ss+'and rs_xueli='+''''+combobox1.Text+'''';
- if combobox2.Text<>'' then
- ss:=ss+'and rs_xb='+''''+combobox2.Text+'''';
- if edit1.Text<>'' then
- ss:=ss+'and rs_depart='+''''+edit1.Text+'''';
- ss:='select * from rsxt where 1=1'+ss;
- ado_rsxt.Close;
- ado_rsxt.SQL.Clear;
- ado_rsxt.SQL.Add(ss);
- ado_rsxt.Open;
- if ado_rsxt.RecordCount=0 then
- begin
- application.MessageBox('没有符合要求的记录,请和管理员联系,请重新输入!','提示',mb_ok+mb_iconinformation);
- end;
- end;
- end;
- procedure Tw_rscx.FormCreate(Sender: TObject);
- begin
- bsy:='rs_gl';
- RadioButton1.Checked;
- w_main.Enabled:=false;
- end;
- procedure Tw_rscx.b_gbClick(Sender: TObject);
- begin
- close;
- end;
- procedure Tw_rscx.b_dyClick(Sender: TObject);
- begin
- frReport1.ShowReport;
- end;
- procedure Tw_rscx.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- w_main.Enabled:=true;
- end;
- end.