unit u_info_leaveword_query; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, RxLookup, wwdbdatetimepicker, Mask, wwdbedit, Wwdotdot, Wwdbcomb, bsSkinCtrls, BusinessSkinForm; type Tfrm_info_leaveword_query = class(TForm) Label10: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; Label13: TLabel; RxDBLookupCombo5: TRxDBLookupCombo; Label14: TLabel; RxDBLookupCombo3: TRxDBLookupCombo; Label5: TLabel; Label6: TLabel; Edit1: TEdit; wwDBComboBox1: TwwDBComboBox; Label7: TLabel; bsSkinButton1: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsBusinessSkinForm1: TbsBusinessSkinForm; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); private { Private declarations } public { Public declarations } end; var frm_info_leaveword_query: Tfrm_info_leaveword_query; implementation uses u_info_leaveword_manage, u_main; {$R *.dfm} procedure Tfrm_info_leaveword_query.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_info_leaveword_query.bsSkinButton10Click(Sender: TObject); begin Edit1.text:=''; wwDBComboBox1.text:=''; wwDBDateTimePicker1.text:=''; wwDBDateTimePicker2.text:=''; RxDBLookupCombo5.ClearValue; RxDBLookupCombo3.ClearValue; end; procedure Tfrm_info_leaveword_query.bsSkinButton1Click(Sender: TObject); var str:widestring; begin str:='where (接受人=:接受人 or 留言人=:留言人)' ; if Edit1.text<>''then str:=str+' and 留言题目 like '+''''+'%'+edit1.text+'%'+''''; if wwDBComboBox1.text<>''then str:=str+' and 是否知道='+''''+inttostr(wwDBComboBox1.ItemIndex)+''''; if wwDBDateTimePicker1.text<>''then str:=str+' and 留言日期>='+''''+wwDBDateTimePicker1.text+''''; if wwDBDateTimePicker2.text<>''then str:=str+' and 留言日期<='+''''+wwDBDateTimePicker2.text+''''; if RxDBLookupCombo5.DisplayValue<>''then str:=str+' and 留言人='+''''+RxDBLookupCombo5.DisplayValue+''''; if RxDBLookupCombo3.DisplayValue<>''then str:=str+' and 接受人='+''''+RxDBLookupCombo3.DisplayValue+''''; frm_info_leaveword_manage.t_info_leaveword.Close; frm_info_leaveword_manage.t_info_leaveword.sql.Clear; frm_info_leaveword_manage.t_info_leaveword.SQL.add('select * from t_info_leaveword '+str); frm_info_leaveword_manage.t_info_leaveword.sql.add(' order by 留言日期'); frm_info_leaveword_manage.t_info_leaveword.Parameters[0].Value:=employee; frm_info_leaveword_manage.t_info_leaveword.Parameters[1].Value:=employee; frm_info_leaveword_manage.t_info_leaveword.open; if frm_info_leaveword_manage.t_info_leaveword.IsEmpty then showmessage('没有检索出所需信息!!') else close; end; procedure Tfrm_info_leaveword_query.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key=#13 then begin key:=#0; frm_info_leaveword_query.bsSkinButton1Click(Sender); end; end; end.