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.

126 lines
2.8 KiB
Plaintext

11 months ago
unit u_crm_query;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinGrids, bsDBGrids, bsSkinCtrls, StdCtrls, Mask,
bsSkinBoxCtrls, DB, ADODB;
type
Tfrm_crm_query = class(TForm)
bsSkinPanel15: TbsSkinPanel;
bsSkinPanel16: TbsSkinPanel;
bsSkinEdit1: TbsSkinEdit;
bsSkinButton52: TbsSkinButton;
bsSkinButton53: TbsSkinButton;
bsSkinButton54: TbsSkinButton;
bsSkinDBGrid1: TbsSkinDBGrid;
t_crm_client1: TDataSource;
t_crm_client: TADOQuery;
DataSource1: TDataSource;
procedure bsSkinButton52Click(Sender: TObject);
procedure bsSkinButton54Click(Sender: TObject);
procedure bsSkinButton53Click(Sender: TObject);
procedure bsSkinDBGrid1DblClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinEdit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_crm_query: Tfrm_crm_query;
implementation
uses u_crm_client,u_main, my_sys_function;
{$R *.dfm}
procedure Tfrm_crm_query.bsSkinButton52Click(Sender: TObject);
var
str:widestring;
begin
str:='where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>'+''''+'Ŀ<><C4BF>'+'''';
if Trim(bsSkinEdit1.text)<>''then
begin
str:=str+' and (<28>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+bsSkinEdit1.text+'%'+''' or <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> like '+''''+'%'+bsSkinEdit1.text+'%'+''')';
end;
str:=str+'and ί<>е<EFBFBD>λ=1';
t_crm_client.close;
t_crm_client.sql.clear;
t_crm_client.sql.add('select * from t_crm_client '+str+' and '+open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>ͷ<EFBFBD>Ա','no','no')+' order by <20><><EFBFBD><EFBFBD>');
t_crm_client.open;
end;
procedure Tfrm_crm_query.bsSkinButton54Click(Sender: TObject);
begin
if not if_open('018') then
begin
showmessage('<27><>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
try
frm_crm_Client:=Tfrm_crm_client.Create (application);
frm_crm_Client.bsSkinButton1Click(Sender);
frm_crm_Client.ShowModal;
finally
frm_crm_Client.Free;
frm_crm_Client:=nil;
end;
end;
procedure Tfrm_crm_query.bsSkinButton53Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_crm_query.bsSkinDBGrid1DblClick(Sender: TObject);
begin
try
if not t_crm_client.IsEmpty then
begin
DataSource1.DataSet.Edit;
DataSource1.DataSet.FieldByName('ί<>е<EFBFBD>λ').AsString:=t_crm_client.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
DataSource1.DataSet.Post;
end;
finally
close;
end;
end;
procedure Tfrm_crm_query.FormShow(Sender: TObject);
begin
t_crm_client.Close;
t_crm_client.Open;
end;
procedure Tfrm_crm_query.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
action:=cafree;
frm_crm_query:=nil;
end;
procedure Tfrm_crm_query.bsSkinEdit1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton52Click(Sender);
end;
end;
end.