You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.8 KiB
Plaintext

unit u_info_card_query;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, bsSkinCtrls,
BusinessSkinForm, RxLookup;
type
Tfrm_info_card_query = class(TForm)
Label15: TLabel;
Edit9: TEdit;
Label16: TLabel;
Edit10: TEdit;
Edit12: TEdit;
Label18: TLabel;
Label17: TLabel;
Edit11: TEdit;
bsSkinButton1: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit4: TEdit;
Label3: TLabel;
Label4: TLabel;
bsBusinessSkinForm1: TbsBusinessSkinForm;
RxDBLookupCombo2: TRxDBLookupCombo;
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure Edit9KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_info_card_query: Tfrm_info_card_query;
implementation
uses u_info_card, u_main;
{$R *.dfm}
procedure Tfrm_info_card_query.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_card_query.bsSkinButton10Click(Sender: TObject);
begin
Edit9.text:='';
Edit10.text:='';
Edit11.text:='';
Edit12.text:='';
Edit1.text:='';
Edit4.text:='';
Edit2.text:='';
RxDBLookupCombo2.ClearValue;
end;
procedure Tfrm_info_card_query.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
begin
str:='';
str:='select * from t_info_card where 录入人='+''''+employee+'''';
if Edit9.text<>''then
str:=str+' and 姓名 like '+''''+'%'+Edit9.text+'%'+'''';
if Edit10.text<>''then
str:=str+' and 办公电话 like '+''''+'%'+Edit10.text+'%'+'''';
if Edit11.text<>''then
str:=str+' and 家庭电话 like '+''''+'%'+Edit11.text+'%'+'''';
if Edit12.text<>''then
str:=str+' and 手机 like '+''''+'%'+Edit12.text+'%'+'''';
if RxDBLookupCombo2.DisplayValues[1]<>''then
str:=str+' and 客户简称 like '+''''+'%'+RxDBLookupCombo2.DisplayValues[1]+'%'+'''';
if Edit1.text<>''then
str:=str+' and 部门 like '+''''+'%'+Edit1.text+'%'+'''';
if Edit4.text<>''then
str:=str+' and 职务 like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str:=str+' and 爱好 like '+''''+'%'+Edit2.text+'%'+'''';
str:=str+' order by 姓名';
with frm_info_card do
begin
t_info_card.close;
t_info_card.sql.Text:=str;
t_info_card.open;
if t_info_card.isempty then
begin
showmessage('没有检索出符合条件的名片!!');
exit;
end;
frm_info_card_query.close;
end;
end;
procedure Tfrm_info_card_query.Edit9KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_info_card_query.bsSkinButton1Click(Sender);
end;
end;
end.